Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
What is the best function to use for stripping out text?
Old 08-17-2008, 11:03 PM What is the best function to use for stripping out text?
Webmaster Talker

Posts: 626
Trades: 0
I'm reading a variabel that will contain a url (ie. http://www.domain.com) and I want to strip out the http:// or https:// part.

What would be the best way of doing this?
jim.thornton is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-17-2008, 11:52 PM Re: What is the best function to use for stripping out text?
thehuskybear's Avatar
Ultra Talker

Posts: 362
Name: Sam
Location: Tucson, AZ
Trades: 1
str_replace() is the simple way however, I would recommend preg_replace()
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
thehuskybear is offline
Reply With Quote
View Public Profile Visit thehuskybear's homepage!
 
Old 08-18-2008, 10:18 AM Re: What is the best function to use for stripping out text?
Skilled Talker

Posts: 61
Trades: 0
You can also use Ereg but Preg is faster so stick to preg_replace.

Pod.
just_a_pod is offline
Reply With Quote
View Public Profile
 
Old 08-18-2008, 01:41 PM Re: What is the best function to use for stripping out text?
Skilled Talker

Posts: 85
Name: Ilyes Rhouma
Trades: 0
same advice: str_replace or preg_replace
__________________
Want a cheap and custom programmer or writer ?
Please login or register to view this content. Registration is FREE

Are you
Please login or register to view this content. Registration is FREE
? Start
Please login or register to view this content. Registration is FREE
free and earning money !
Please login or register to view this content. Registration is FREE
Ilyes is offline
Reply With Quote
View Public Profile Visit Ilyes's homepage!
 
Old 08-18-2008, 01:46 PM Re: What is the best function to use for stripping out text?
Webmaster Talker

Posts: 626
Trades: 0
thanks for the responses... I discovered the $_SERVER variable had SERVER_NAME and then REQUEST_URI and I just used that instead of stripping out the http://
jim.thornton is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to What is the best function to use for stripping out text?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.66427 seconds with 12 queries