note 88181 deleted from function.strpos by danbrown
| From: | danbrown@php.net | Date: | Wed, 14 Jan 2009 18:39:38 +0000 |
| Subject: | note 88181 deleted from function.strpos by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-149191@lists.php.net to get a copy of this message | ||
Note Submitter: tompsonn at futurionpower dot com
----
jburns131 at jbwebware dot com, this will achieve the same:
$string = "dbHost";
if ( ( $pos = strpos( $string, "db" ) ) !== FALSE )
{
echo ( $pos === 0 ) ? 'was first pos' : 'not first pos';
// similarly:
// return ( $pos === 0 ) ? TRUE : FALSE
}