Sunday 30 July 2017

Difference Between Comparison Operators in php.

If you use strpos() to determine whether a substring exists within a string (it returns FALSE

<?php
 
$authors = 'Chris & Sean';
 
if (strpos($authors, 'Chris')) {
    echo 'Chris is an author.';
} else {
    echo 'Chris is not an author.';
}
 
?>

No comments:

Post a Comment