Jump to content

Checking the length of a string


AKalair

Recommended Posts

Hiya,

Im trying to check the length of this string is between 1 and 5 characters. But when I run this I get this error message.

 

"Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /www/001webs.com/p/h/p/phpforum91/htdocs/time.php on line 7"

 

<?php

$abcd = 'abcd';

$Length = strlen("$abcd");

if ($strlen '>0' && '6<' )
{
echo "$Length";
}
else
{echo "too long";
}

?>

 

Any ideas?

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/152589-checking-the-length-of-a-string/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.