<?php
$str = 'component/content/article?id=9';
$query = parse_url($str, PHP_URL_QUERY); // Get the string part after the "?"
parse_str($query, $params);
print $params['id'];
Notice: Use of undefined constant PHP_URL_QUERY - assumed 'PHP_URL_QUERY' in /in/TRYpd on line 3
Warning: parse_url() expects exactly 1 parameter, 2 given in /in/TRYpd on line 3
Notice: Undefined index: id in /in/TRYpd on line 5