Jump to content

[SOLVED] preg_match help


pgrevents

Recommended Posts

I am trying to grab information out of this

<div style="overflow: hidden; background-image: url(http://s.bebo.com/img/bebobadge_1_black.gif); background-repeat: no-repeat; width: 300px; height: 175px;"><span style="width:90px; height:90px;"><a href="http://www.bebo.com/badge/9211222062"><img src="http://www.bebo.com/profilephoto/9211222062a1363459018bblack.jpg" style="border: 0pt none ; margin: 10px 0pt 27px 10px; width: 90px; height: 90px;"></a></span><br><a href="http://www.bebo.com/badge/9211222062" style="padding: 0pt 0pt 0pt 10px; overflow: hidden; display: block; color: white; font-weight: bold; font-size: 16px; width: 300px;">PGR Events</a><a href="http://www.bebo.com/badge/9211222062" style="padding: 0pt 0pt 0pt 10px; display: block; color: white; font-weight: bold; font-size: 12px;">http://www.bebo.com/pgrevents</a><br></div>

 

specifcly the profile photo bit http://www.bebo.com/profilephoto/9211222062a1363459018bblack.jpg

 

As you will notice with the code i am trying to get is numbers then a then numbers...

I can get the numbers before the a fine using;

<?php
session_start();
$catch = $_POST['code'];
preg_match('#/profilephoto/a(\d+)#', $catch, $match);
$pop = array_pop($match);
?>

 

Its the part after the letter I cannot seem to grab.

 

Am I on the right track here or is there another most probably easier way lol

 

 

thanks

 

Paul

 

Link to comment
https://forums.phpfreaks.com/topic/157431-solved-preg_match-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.