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. Quote 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 Quote Link to comment https://forums.phpfreaks.com/topic/280568-string-lengh/#findComment-1442406 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.