note 101241 modified in function.strnatcmp by danbrown
| From: | danbrown@php.net | Date: | Sat, 04 Dec 2010 23:14:39 +0000 |
| Subject: | note 101241 modified in function.strnatcmp by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-174613@lists.php.net to get a copy of this message | ||
If you want to compare $_SESSION variables to a string use this
<?php
if(isset($_SESSION['usertype']))
{
echo "usertype " .$_SESSION['usertype'];
$ut = $_SESSION['usertype'];
if(strnatcmp($ut,"admin"))
{
echo "hello admin";
}
}
?>
--was--
If you want to compare $_SESSION variables to a string use this
if(isset($_SESSION['usertype']))
{
echo "usertype " .$_SESSION['usertype'];
$ut = $_SESSION['usertype'];
if(strnatcmp($ut,"admin"))
{
echo "hello admin";
}
}
http://php.net/manual/en/function.strnatcmp.php