Thanks everyone! 🙂
I can't use $_GET because i collect the url from a form as a string. And i have no real use for parse_url since there can be several querys in my url, and i only want the value of 'id'.
I've tried this code:
$pattern = '/tavling=([0-9]*?)/i';
preg_match_all($pattern, $_POST[url], $matches);
foreach($matches[1] as $key => $val) {
echo "'".$val."'";
}
But it doesn't find anything, or more correct, it looks as if it finds something but the results i get looks like this: ''
Why is that?