note 63622 added to function.strpos

From: Date: Sat, 25 Mar 2006 23:09:53 +0000
Subject: note 63622 added to function.strpos
Groups: php.notes 
Request: Send a blank email to php-notes+get-106614@lists.php.net to get a copy of this message
This may be less than useful to many of you, but- being a bit of a perfectionist, I like to make sure that web pages always display according to grammatical rules. Incorrect use of the posessive apostrophe seems to run rampant on the web, so you can use this to correct for it (say, when pulling an employee name from a database). if (strpos(strrev($firstName), "s")==0 || strpos(strrev($firstName), "x")==0){ $firstNamePosessive = $firstName . "'"; }else{ $firstNamePosessive = $firstName . "'s"; } echo $firstNamePosessive . " PHP code."; //returns "John's PHP code." //or, if the name ends in x or s, //returns "Charles' PHP code." ---- Server IP: 64.71.164.2 Probable Submitter: 149.159.161.6 ---- X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER autolearn=no version=2.64 ---- Manual Page -- http://www.php.net/manual/en/function.strpos.php Edit -- http://master.php.net/note/edit/63622 Del: integrated -- http://master.php.net/note/delete/63622/integrated Del: useless -- http://master.php.net/note/delete/63622/useless Del: bad code -- http://master.php.net/note/delete/63622/bad+code Del: spam -- http://master.php.net/note/delete/63622/spam Del: non-english -- http://master.php.net/note/delete/63622/non-english Del: in docs -- http://master.php.net/note/delete/63622/in+docs Del: other reasons-- http://master.php.net/note/delete/63622 Reject -- http://master.php.net/note/reject/63622 Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#106614) next »