I have something in php, which goes through a line of text, replacing all occurences of %longip($a) with the long2ip/ip2long of whatever's in the perentheses. I tried something similar with %ial($a,$b), to call ial_search($a,$b) and replace the %ial() with the result. I have it so the longip can be stacked: %longip(%longip(%longip($a))) and it would call the proper function(s) 3 times. I'm trying to get it to do the same with %ial. The %ial takes a string as the first arg, and a number as the second. If the second is 0, it returns a number. What I have so far is:
while (ereg("%ial\([^[:blank:]]{1,},[0-9]{1,}\)",$text,$temp)) { $ialsearch = explode(",",right(left($temp['0'],-1),-5)); $text = str_replace($temp['0'],ial_search($ialsearch['0'],$ialsearch['1']),$text); } Any help will be greatly appreciated. __________________________________________________ Do You Yahoo!? Send FREE video emails in Yahoo! Mail! http://promo.yahoo.com/videomail/ -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]