regex trouble... please help!
Posted: Sun Feb 13, 2011 9:05 pm
<img src="http://c3.ac-images.myspacecdn.com/imag ... 6d9932.jpg" class="profilePic" alt="Photo of ıł♥νeчøυ(:" />
I NEED to use preg_match for this...
The img src will be different everytime and so will the alt.
here is the code i have so far but i cant seem to get it right... the only piece of info i need out of the string above is the img src
but once again... i need to find in with preg match in that certain string. please and thanks for any help
$fid = 178902;
$getfid = $fid;
$ip = $_SERVER['REMOTE_ADDR'];
define ("getFID","http://www.myspace.com/" );
$path = getFID.$getfid;
$holdID = file_get_contents($path);
define ("profile_url","http://mx.myspace.com/" );
$full_file_path = profile_url.$fid;
$handle = fopen("http://myspace.com/$fid","r");
if (!$handle){
echo "<p>Sorry Myspace Is Slow Try Again.\n";
$arr = 0; }
else {
$timeout = 300;
ini_set('max_execution_time','120');
set_time_limit(120);
ini_set('default_socket_timeout','120');
while($contents = fread($handle,'1024'))
{ $hold .= $contents; }
preg_match("<img src=\"([^\">]+)\" class=\"profilePic\" alt=\".*?\" />",$hold,$match);
I NEED to use preg_match for this...
The img src will be different everytime and so will the alt.
here is the code i have so far but i cant seem to get it right... the only piece of info i need out of the string above is the img src
but once again... i need to find in with preg match in that certain string. please and thanks for any help
$fid = 178902;
$getfid = $fid;
$ip = $_SERVER['REMOTE_ADDR'];
define ("getFID","http://www.myspace.com/" );
$path = getFID.$getfid;
$holdID = file_get_contents($path);
define ("profile_url","http://mx.myspace.com/" );
$full_file_path = profile_url.$fid;
$handle = fopen("http://myspace.com/$fid","r");
if (!$handle){
echo "<p>Sorry Myspace Is Slow Try Again.\n";
$arr = 0; }
else {
$timeout = 300;
ini_set('max_execution_time','120');
set_time_limit(120);
ini_set('default_socket_timeout','120');
while($contents = fread($handle,'1024'))
{ $hold .= $contents; }
preg_match("<img src=\"([^\">]+)\" class=\"profilePic\" alt=\".*?\" />",$hold,$match);