hi guys,
i have a rege code that looks to see if a block of text has a link.
i have modded it to show the link as an image if it exists (badly i know this method isnt very good)
what i need to do is check if the text contains a link, image,or video (youtube/dailymotion etc) and then display the right output
heres what i have
<?php
$convertlinkmsg = $message->message;
$convertlinkmsg = preg_replace( '/(http|ftp)+(s)?:(\/\/)((\w|\.)+)(\/)?(\S+)?/i', '<a target="_blank" class="imgsoc " href="\0"><img src="\0" alt="\4"/></a>', $convertlinkmsg);
echo $convertlinkmsg ; ?>
any ideas?
thanks