moisesbr Posted July 27, 2013 Share Posted July 27, 2013 I want to execute a command if the lengh of a string is equal 11 Using: if (strlen($cpf) = 11 { //codes... } But I got message : Fatal error: Can't use function return value in write context in /home/monitorr/public_html/busca_correios.php on line 49 Line 49 is that one, but am not sure if there is an error in this funcion. Link to comment https://forums.phpfreaks.com/topic/280568-string-lengh/ Share on other sites More sharing options...
Barand Posted July 27, 2013 Share Posted July 27, 2013 You get the message because you are trying to assign the value 11 to the function result. "==" is the equality operator "=" is the assignment operator Link to comment https://forums.phpfreaks.com/topic/280568-string-lengh/#findComment-1442406 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.