Как може това да стане с preg_match???

smeshko2008

Registered
Здравейте,

Искам да попитам как мога да направя така, че чрез preg_match когато се изпише http:// link.com да го прави автоматично на линк (<a href="http://link.com">http://link.com</a>)... Ако искате да ви дам и част от файла, който се опитвам да направя:

Код:
Producers
JLDM - http://comment.myspace.com/index.cfm?fuseaction=user.viewProfile_commentForm&friendID=208156209
*EVA-DIVA* *MUSIC* - http://comment.myspace.com/index.cfm?fuseaction=user.viewProfile_commentForm&friendID=98453263
Mister-E - http://comment.myspace.com/index.cfm?fuseaction=user.viewProfile_commentForm&friendID=202440662
Rhythm City - http://comment.myspace.com/index.cfm?fuseaction=user.viewProfile_commentForm&friendID=175613713
VAR!O (Beat Addicts) - http://comment.myspace.com/index.cfm?fuseaction=user.viewProfile_commentForm&friendID=53841502
CHRONIKAL - http://comment.myspace.com/index.cfm?fuseaction=user.viewProfile_commentForm&friendID=131623304
A Wolf In Yon Abbey  - http://comment.myspace.com/index.cfm?fuseaction=user.viewProfile_commentForm&friendID=181386542
EvaxxDJ - http://comment.myspace.com/index.cfm?fuseaction=user.viewProfile_commentForm&friendID=12884682  
ben max - http://comment.myspace.com/index.cfm?fuseaction=user.viewProfile_commentForm&friendID=203006820
10 BLONDES IN THE GROOVE - http://comment.myspace.com/index.cfm?fuseaction=user.viewProfile_commentForm&friendID=124921108
Samsasvic - http://comment.myspace.com/index.cfm?fuseaction=user.viewProfile_commentForm&friendID=128630325
The Tombstone - http://comment.myspace.com/index.cfm?fuseaction=user.viewProfile_commentForm&friendID=73670875
Scott Quick & Gavin Stiles - http://comment.myspace.com/index.cfm?fuseaction=user.viewProfile_commentForm&friendID=52940395
GRAVEMACHINE - http://comment.myspace.com/index.cfm?fuseaction=user.viewProfile_commentForm&friendID=27201533
Chamberlane - http://comment.myspace.com/index.cfm?fuseaction=user.viewProfile_commentForm&friendID=19898581
Leonardo Smoothly Rude - http://comment.myspace.com/index.cfm?fuseaction=user.viewProfile_commentForm&friendID=163229269
[] Extreme Sounds - http://comment.myspace.com/index.cfm?fuseaction=user.viewProfile_commentForm&friendID=120353654
komplex audio - http://comment.myspace.com/index.cfm?fuseaction=user.viewProfile_commentForm&friendID=183293464
ATOMIC HOOLIGAN - http://comment.myspace.com/index.cfm?fuseaction=user.viewProfile_commentForm&friendID=3791568
Swayzak - http://comment.myspace.com/index.cfm?fuseaction=user.viewProfile_commentForm&friendID=5089580
AMB - http://comment.myspace.com/index.cfm?fuseaction=user.viewProfile_commentForm&friendID=56802987
Laptop Dancer - http://comment.myspace.com/index.cfm?fuseaction=user.viewProfile_commentForm&friendID=73641614
Tinge - http://comment.myspace.com/index.cfm?fuseaction=user.viewProfile_commentForm&friendID=222574796
Leigh - http://comment.myspace.com/index.cfm?fuseaction=user.viewProfile_commentForm&friendID=8661086
Elektroworks Electro House - http://comment.myspace.com/index.cfm?fuseaction=user.viewProfile_commentForm&friendID=161986900
MARSEL DURI - http://comment.myspace.com/index.cfm?fuseaction=user.viewProfile_commentForm&friendID=173677313
Dj Dynamat  - http://comment.myspace.com/index.cfm?fuseaction=user.viewProfile_commentForm&friendID=36540214
[] SUBWAY HOT CHART  - http://comment.myspace.com/index.cfm?fuseaction=user.viewProfile_commentForm&friendID=157268791
Will Dashwood - http://comment.myspace.com/index.cfm?fuseaction=user.viewProfile_commentForm&friendID=193370474
[] Goodguy - http://comment.myspace.com/index.cfm?fuseaction=user.viewProfile_commentForm&friendID=151833761
SIZE ZERO - http://comment.myspace.com/index.cfm?fuseaction=user.viewProfile_commentForm&friendID=187523807


DJs
DJ Lusty - http://comment.myspace.com/index.cfm?fuseaction=user.viewProfile_commentForm&friendID=93310295
DJ Andy B - http://comment.myspace.com/index.cfm?fuseaction=user.viewProfile_commentForm&friendID=214798126
Mizota - http://comment.myspace.com/index.cfm?fuseaction=user.viewProfile_commentForm&friendID=4406684
doubtingthomas - http://comment.myspace.com/index.cfm?fuseaction=user.viewProfile_commentForm&friendID=115742445
[] Luke Hush - http://comment.myspace.com/index.cfm?fuseaction=user.viewProfile_commentForm&friendID=33358662


Producers and DJs
Parallel Sound - http://comment.myspace.com/index.cfm?fuseaction=user.viewProfile_commentForm&friendID=74111391
[] Pedro Delgardo - http://comment.myspace.com/index.cfm?fuseaction=user.viewProfile_commentForm&friendID=66365852
DJ Carlos Francisco - http://comment.myspace.com/index.cfm?fuseaction=user.viewProfile_commentForm&friendID=72183989
Tania-J - http://comment.myspace.com/index.cfm?fuseaction=user.viewProfile_commentForm&friendID=166116164
disco assassins - http://comment.myspace.com/index.cfm?fuseaction=user.viewProfile_commentForm&friendID=228659152
Chemical Brothers - http://comment.myspace.com/index.cfm?fuseaction=user.viewProfile_commentForm&friendID=7656579
Basement Jaxx - http://comment.myspace.com/index.cfm?fuseaction=user.viewProfile_commentForm&friendID=8718322
[] Underworld - http://comment.myspace.com/index.cfm?fuseaction=user.viewProfile_commentForm&friendID=5550345
[] Darien J - http://comment.myspace.com/index.cfm?fuseaction=user.viewProfile_commentForm&friendID=45893540
Pete Tong - http://comment.myspace.com/index.cfm?fuseaction=user.viewProfile_commentForm&friendID=38092057
JON GURD - http://comment.myspace.com/index.cfm?fuseaction=user.viewProfile_commentForm&friendID=36579952
Danny Howells - http://comment.myspace.com/index.cfm?fuseaction=user.viewProfile_commentForm&friendID=35663697
Omid 16B - http://comment.myspace.com/index.cfm?fuseaction=user.viewProfile_commentForm&friendID=55105677

10x Предварително :)
 
с preg_replace ще стане ,но да уточним нещо :

JLDM - http://comment.myspace.com/index.cfm?fuseaction=user.viewProfile_commentForm&friendID=208156209

ще стане пр.
1) <a href="http://comment.myspace.com/index.cfm?fuseaction=user.viewProfile_commentForm&friendID=208156209">http://comment.myspace.com/index.cfm?fuseaction=user.viewProfile_commentForm&friendID=208156209</a>
или
2)
<a href="http://comment.myspace.com/index.cfm?fuseaction=user.viewProfile_commentForm&friendID=208156209">JLDM <a/>

кое от 2те?
 
Второто мисля че ще е по-добре... Все пак мога ли да прочета някъде как се работи с тази функция, защото не веднъж ми се налага да я ползвам :)
 

Back
Горе