note 61939 added to function.strpos

From: Date: Wed, 15 Feb 2006 15:49:44 +0000
Subject: note 61939 added to function.strpos
Groups: php.notes 
Request: Send a blank email to php-notes+get-103775@lists.php.net to get a copy of this message
"fox_galih at yahoo dot co dot uk" example below is absolutely not needed. As the example on this page shows, you can differentiate between position 0 and false by doing a strict comparison (===): $newsbody = "<p>This is paragraph</p>"; if( strpos( $newsbody, "<p>" ) === 0 ) { // will only get executed if string starts with <p> // (false === 0) evaluates to false } ---- Server IP: 64.71.164.2 Probable Submitter: 70.117.198.100 ---- Manual Page -- http://www.php.net/manual/en/function.strpos.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+61939 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+61939&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+61939&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+61939&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+61939&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+61939&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+61939&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+61939&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+61939&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#103775) next »