<?
$text= "[align=center]
pictureit(2265:border:150::1:0:1) pictureit(2266:border:150::1:0:1) pictureit(2269:border:150::1:0:1)[/align]";
$text = explode(" ", $text);
foreach ($text as $key){
$matched = preg_match('/.*pictureit\(.*\).*/', $key);
if ($matched == 1){
$data = preg_replace("/.*pictureit\(/", "", $key);
$data = preg_replace("/\).*/", "", $data);
//$key = str_replace(")", "", $key);
list($id, $style, $width, $height, $comments, $float, $link) =
split(":", $data, 7);
echo "<br><b>id:$id<br>style:$style<br>width:$width<br>height:$height<br>comments:$comments<br>float:$float<br>link:$link</b><br>";
}
}
?>
I have set $text as an example of the situation i came accross when trying to test my function. the $id should read an int, but rather it gives me the [align stuff because its on the top line and not considered a space that preg_replace could take out after $matched == 1.. Any ideas on how to remove the line break in the $data variable but not the $key.. Any help much appreciated, thanks alot
CHADian