Welcome visitor
* Login
* Register
It is currently July 19th, 2019, 6:33 pm
All times are UTC [ DST ]
* Search
View unanswered posts - View active topics

FORUMS » Server Side » PHP



Post new topic Reply to topic  [ 2 posts ] 
Author Message
  fixing a string
PostPosted: February 17th, 2009, 6:37 am 
User avatar

Posts: 52
Hi everyone,

In may website the user needst to enter his/her name, but sometimes they wirte like Dr. John Williams or something like that, what can i do to get rid of the "Dr." and just keep the John Williams?

Any help is well appreciated, thanks.


Top
 Profile  
 
  Re: fixing a string
PostPosted: February 17th, 2009, 6:40 am 

Posts: 55
$newname = substr($name,strpos("$name",".")+1); // this is to clear the "Dr."
$newname = ltrim($newname);//and this removes any spaces


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

FORUMS » Server Side » PHP


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron