note 104614 added to function.substr

From: Date: Sun, 26 Jun 2011 05:33:45 +0000
Subject: note 104614 added to function.substr
Groups: php.notes 
Request: Send a blank email to php-notes+get-180955@lists.php.net to get a copy of this message
I used the following to return the first word in a string of words up to the first occurence of a delimiter character. $firstWord = substr($wString, 0, -strlen($wString, $delimiter); For example: for $wString = "This is great"; $delimiter = " "; Then $firstWord = "This" Cheers. Alex. ---- Server IP: 69.147.83.197 Probable Submitter: 71.170.112.136 ---- Manual Page -- http://www.php.net/manual/en/function.substr.php Edit -- https://master.php.net/note/edit/104614 Del: integrated -- https://master.php.net/note/delete/104614/integrated Del: useless -- https://master.php.net/note/delete/104614/useless Del: bad code -- https://master.php.net/note/delete/104614/bad+code Del: spam -- https://master.php.net/note/delete/104614/spam Del: non-english -- https://master.php.net/note/delete/104614/non-english Del: in docs -- https://master.php.net/note/delete/104614/in+docs Del: other reasons-- https://master.php.net/note/delete/104614 Reject -- https://master.php.net/note/reject/104614 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#180955) next »