simple simple preg question
Posted: Mon Nov 24, 2003 7:53 am
Help....
I have this code:
It displays images ( sometimes...)...how can I also add in a facility for displaying URLs that are clickable...
I thought:
but it does not work
I have this code:
Code: Select all
<?php
$data = file('./news2/news.dat');
$data = array_reverse($data);
foreach($data as $element) {
$result = preg_replace('/\\[img\\](.+?)\\[\\/img\\]/', '<img src="\\1">',$pieces[2]);
$element = trim($element);
$pieces = explode("|", $element);
echo $pieces[2] .
"<BR>" .
"<b>Posted by " .
$pieces[1] .
" on " .
$pieces[0] .
"</b> <BR><BR>".
$result ;
}
?>I thought:
Code: Select all
$result1 = preg_replace('/\\їurl=(.*?)\\](.*?)\\ї\\/url\\]/', '<a href="\\1"><\/a>',$piecesї2]);but it does not work