Hello i have in my php file this $name = 'blablabla'; PHP: - and how can i check if the string $name exists also how can i check if $name isnt empty or if have the word included the letter a? thanks
To check if the variable $name is set and not empty you can use the isset and empty construct. To check if the string contains an "a" you can use the function strpos which will return the position a specified string was found or false if it was not found You can take a look how these constructs and function work at php.net
if(isset($name)==false) { //Value Is Not Set } elseif($name == "") { //Value is an empty string } PHP: