note 88181 added to function.strpos

From: Date: Wed, 14 Jan 2009 06:37:46 +0000
Subject: note 88181 added to function.strpos
Groups: php.notes 
Request: Send a blank email to php-notes+get-149181@lists.php.net to get a copy of this message
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 } ---- Server IP: 117.104.160.194 Probable Submitter: 121.221.228.130 ---- Manual Page -- http://www.php.net/manual/en/function.strpos.php Edit -- https://master.php.net/note/edit/88181 Del: integrated -- https://master.php.net/note/delete/88181/integrated Del: useless -- https://master.php.net/note/delete/88181/useless Del: bad code -- https://master.php.net/note/delete/88181/bad+code Del: spam -- https://master.php.net/note/delete/88181/spam Del: non-english -- https://master.php.net/note/delete/88181/non-english Del: in docs -- https://master.php.net/note/delete/88181/in+docs Del: other reasons-- https://master.php.net/note/delete/88181 Reject -- https://master.php.net/note/reject/88181 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#149181) next »