php string at code example
Example 1: if part of stringp ph
$a = 'How are you?';
if (strpos($a, 'are') !== false) {
echo 'true';
}
Example 2: PHP strings
<?php
echo 'this is a simple string';
echo 'You can also have embedded newlines in
strings this way as it is
okay to do';
echo 'Arnold once said: "I\'ll be back"';
echo 'You deleted C:\\*.*?';
echo 'You deleted C:\*.*?';
echo 'This will not expand: \n a newline';
echo 'Variables do not $expand $either';
?>
Example 3: strings php
returning portion of a string