I need to extract an item id from a URL; the pattern is this &R=10031004&, I mean, I need to extract the string within &R= and the other &
This is what I have so far, but I keep getting errors.
preg_match('^[&R=]+ &$',
"http://www.lapdirecciondemario.com/items.php&R=10031004&", $matches);
$host = $matches[0];
echo $host;