note 63622 deleted from function.strpos by nlopess

From: Date: Thu, 27 Apr 2006 18:20:46 +0000
Subject: note 63622 deleted from function.strpos by nlopess
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-109875@lists.php.net to get a copy of this message
Note Submitter: jopalmer at ALREADYGETTINGPSPAM dot indiana dot edu ---- 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."

« previous php.notes (#109875) next »