That sounds like what I am looking for. But would there be a way to make it with the $a variable so I could just add the $a where I needed it instead of having to do the doapostrophe all over the site? And I could put this anywhere in the functions.php and it would work site wide, right? Or do I need to put it a certain place in there?
Quote:
Originally posted by PPN
you could just make a function
function doapostrophe($username) {
if (preg_match ("(\\'$)", $username)) {
$username .= 's';
} else {
$username .= '\\'s';
}
return $username;
}
and when you need to just use
$userinfo['username'] = doapostrophe($userinfo['username']);
something like that?
|