ed
Member
Registered: 10th Sep 03
User status: Offline
|
Are you allowed to do something like this (i.e. use a function as your replace string)?
$content=preg_replace('/cms\:\/\/video\.(qvga|vga|hd)\.([0-9]*)/',videoPlayer($2),$content);
I can't seem to get it to work...
|
Laney
Member
Registered: 6th May 03
Location: Leeds
User status: Offline
|
$2 isn't gonna work is it?
|
ed
Member
Registered: 10th Sep 03
User status: Offline
|
Been having a bit of a search around and you are meant to use the e modifier like so:
$content=preg_replace('/cms\:\/\/video\.(qvga|vga|hd)\.([0-9]*)/e',"videoPlayer('\\2')",$content);
Which does the job
|
ed
Member
Registered: 10th Sep 03
User status: Offline
|
(By turning cms://video.qvga.86 into the right flavour of video embed code (Flash at the moment ))
|