You're missing the ; on this line:

$result=strcmp($firstword, $secondword)



Anthony Ritter wrote:

The following test script for the function strcmp() is from page 114 -115 of
PHP (Hungry Minds).

I'm getting a parse error on line 6.

Using PHP 4.1.1 / MS Win 98 / Apache Server.

Many thanks...
Tony Ritter
..........................................

<?
// using strcmp()
$firstword="peach";
$secondword="mango";
$result=strcmp($firstword, $secondword)
if ($result>=1)
{
 $statement="comes after";
}
else if ($result<=-1)
{
 $statement="comes before";
}
else
{
 $statement="is the same as";
}
echo "The word <b>$firstword</b> $statement";
?>








-- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.




-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to