/    Sign up×
Community /Pin to ProfileBookmark

catch word in sentence

Hi,

Is there a way to pick one part of an sentence out of and sentence..
What i have is:

[code=php]<span class=’text’>test</span><span class=’tag’><br><img src=’img/line2.gif’ width=’450′ height=’14’ border=’0′ /><br /></span><span class=’voetnoot’>By: joost &clubs; 10-08-2006 / 13:05:12 | <a href=’mailto:[email protected]’>@</a> | <a href=’http://www.ok-parking.nl’ target=’_blank’>www</a></span>[/code]

What i need is a php script that takes everything that is between the
[B]href=’mailto:[/B] and [B]‘>@</a>[/B]. So infact the e-mail adres in the sentence…but the emailadres is different every time..??

Thanks in advance..

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@NogDogAug 10.2006 — Untested:
[code=php]
$email = (preg_match('/(?<=<a href=['"]mailto:)[^'"]+@[^'"]+/i', $text, $matches)) ?
$matches[0] : '' ;
[/code]
×

Success!

Help @zebdaag spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...