12-23-2009, 01:16 AM
|
#2 (permalink)
|
|
is cute and cuddly
Join Date: Mar 2008
Location: Vegas, Baby
Posts: 963
Thanks: 31
|
php Code:
header( "Content-type: text/plain" ); function add_lightbox ( $ret ) { return preg_replace( '~(<a[^>]+)>([^<]+</a>)~', '$1 rel="lightbox">$2', $ret ); }echo add_lightbox ( '<a href="http://domain.tld/test/">test</a>' );
Note that this does not check for the existence of an existing rel attribute - it only adds one. But it should get you started down the right path to figuring that out. ;)
|
|
|
|