does a string come before or after another
am 20.01.2006 20:17:13 von laredotornadoHello,
Given two strings, a and b, how would I determine if a is
alphabetically greater than or less than b? I'm using PHP 4.
Thanks, - Dave
Hello,
Given two strings, a and b, how would I determine if a is
alphabetically greater than or less than b? I'm using PHP 4.
Thanks, - Dave
Dave, you should be able to apply the greater than/less than operators
to a string:
$a = "fdsa";
$b = "asdf";
if ($a > $b)
{
echo "a is greater";
}
else
{
echo "b is greater";
}
// will echo "a is greater"