I have a blog post, and i want to run the function ... functionit() on.. ive created this function to look for pictureit(), and it successfully does it job but only one instance, how would i have my function run through out the entire block of text.
function functionit($text){
$slicedup = strrchr($text, 'pictureit(');
$slicedup = str_replace("pictureit(", "", $slicedup);
$slicedup = str_replace(strrchr($slicedup, ')'),"",$slicedup);
list($id, $style, $width, $height, $comments, $float) =
split(":", $slicedup, 6);
echo "id: $id , style: $style, width: $width, height: $height, comments: $comments, float: $float";
}
functionit("blah blah blah pasdfa pictureit(id:style:width:height:comments:float) asdfa");
i was practicing on that block of text.. but what if i had more than one pictureit() it only caught the 2nd instance found... and ill probably have several pictureit() functions. i figure there's a while statememnt needed, but i do not know how to implement it.