?
Solved

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

Posted on 2008-06-22
3
Medium Priority
?
248 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 48

Accepted Solution

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

Expert Comment

by:Roonaan
ID: 21843755
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
ID: 21843762
THANK YOU
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
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…
Suggested Courses

765 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