Solved

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

Posted on 2008-06-22
3
203 Views
Last Modified: 2008-07-03
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
0
Comment
Question by:Bettering
3 Comments
 
LVL 48

Accepted Solution

by:
hernst42 earned 500 total points
Comment Utility
preg_match('/odes\.php%3Fusr_click_id%3D(\d+)%26/', $html, $m);#
echo $m[1];
0
 
LVL 49

Expert Comment

by:Roonaan
Comment Utility
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
0
 

Author Comment

by:Bettering
Comment Utility
THANK YOU
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
spacing 5 23
MySQL database data submission 7 37
How to validate 2 forms at once 8 24
session dropped in IE 10 18
Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now