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
extracting part of a string
Old 07-13-2010, 04:59 AM extracting part of a string
numbenator's Avatar
Webmaster Talker

Posts: 523
Location: London
Trades: 0
HI

Im a little stuck with regular expressions.

i basically require to extract everything after 'http://twitter.com/' and before the next '/' in the below url

http://twitter.com/ssmason/statuses/18420608816

How do i do this please?

Cheers
__________________

Please login or register to view this content. Registration is FREE
numbenator is offline
Reply With Quote
View Public Profile Visit numbenator's homepage!
 
 
Register now for full access!
Old 07-13-2010, 05:16 AM Re: extracting part of a string
NullPointer's Avatar
Will Code for Food

Posts: 2,815
Name: Matt
Location: Irvine, CA
Trades: 0
You don't need a regex:
PHP Code:
$parts explode('/''http://twitter.com/ssmason/statuses/18420608816');

echo 
$parts[3]; //ssmason 
__________________

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
|
Please login or register to view this content. Registration is FREE
NullPointer is online now
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Old 07-13-2010, 05:18 AM Re: extracting part of a string
numbenator's Avatar
Webmaster Talker

Posts: 523
Location: London
Trades: 0
Ofcourse!! Sorry. Sometimes it takes fresh eyes.

Thanks very much for you input.

Steve
__________________

Please login or register to view this content. Registration is FREE
numbenator is offline
Reply With Quote
View Public Profile Visit numbenator's homepage!
 
Reply     « Reply to extracting part of a string
 

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 1.21167 seconds with 12 queries