Forum Moderators: coopster
.........
so.addParam("articleno", "itemID=389598&mediaURI=http://site.com/Files/%5BFile%20www.site.com%5D%20389598.2790557.11.htm
&postContentURL=http://site.com/Catalog_1.1.0.2.php&description=.......
I need to extract itemID and the URI
@preg_match('#"articleno", "itemID=([0-9]+)&mediaURI=(?)&postContentURL=#', $data, $matches);
What is the pattern that should come here?
Thanks a million in advance ..
$str = "itemID=389598&mediaURI=http://site.com/Files/%5BFile%20www.site.com%5D%20389598.2790557.11.htm
&postContentURL=http://site.com/Catalog_1.1.0.2.php";
$pattern = "/(itemID=[0-9]+)¦(mediaURI=http:\/\/[a-zA-Z0-9]{3,}\.[a-zA-Z]{2,}[a-zA-Z0-9\.\_\-\/\%]+)/si";
preg_match_all($pattern, $str, $matches);
print_r($matches);
it would be a lot easier if you use split() or explode() if you just want to extract those vars.
$arr = explode("&", $str); // or $arr = split("&", $str);