Link to home
Start Free TrialLog in
Avatar of Bettering
Bettering

asked on

PHP REGEXP PLEASE (I CANT BELIEVE I CANT FIGURE THIS OUT FROM ALL THE EXAMPLES)

odes.php%3Fusr_click_id%3D2151%26usr_schedule_id%3D24x7%26ste

I need the # 2151 from a page full of html but the above is a 'snippet' from it
ASKER CERTIFIED SOLUTION
Avatar of hernst42
hernst42
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Roonaan
Hello Bettering,

Try:

<?php

$url = 'odes.php%3Fusr_click_id%3D2151%26usr_schedule_id%3D24x7%26ste';

$_url = urldecode($url);
$_parts = parse_url($_url);
$_query = $_parts['query'];
parse_str($_query, $_array);

echo 'Click id: '.$_array['usr_click_id'];
?>


Regards,

Roonaan
Avatar of Bettering
Bettering

ASKER

THANK YOU