orbitz
04-15-2004, 12:37 AM
hi,
if i have this string:
$original_str = "<img src='http://localhost/images/1.gif' border='0' alt='user posted image' /><br><br>testing images";
I have 2 questions:
1- how to get the link to the image from the above string
2- after I have determined the image's dimesion (i can do this part),
how do I add the width and length back to the string above?
How do i get the link from the above string?
the result should be:
'http://localhost/images/1.gif'
The reason i need to get this link out is to determine the dimension of the image and then add the width and height back to the original above:
suppose that:
$mylink = 'http://localhost/images/1.gif'
//
$img_sz = getimagesize($mylink);
$width = $img_sz[0];
$height = $img_sz[1];
// from here, how do i add the width and height back to the $oringial_str ?
Thanks for your help
if i have this string:
$original_str = "<img src='http://localhost/images/1.gif' border='0' alt='user posted image' /><br><br>testing images";
I have 2 questions:
1- how to get the link to the image from the above string
2- after I have determined the image's dimesion (i can do this part),
how do I add the width and length back to the string above?
How do i get the link from the above string?
the result should be:
'http://localhost/images/1.gif'
The reason i need to get this link out is to determine the dimension of the image and then add the width and height back to the original above:
suppose that:
$mylink = 'http://localhost/images/1.gif'
//
$img_sz = getimagesize($mylink);
$width = $img_sz[0];
$height = $img_sz[1];
// from here, how do i add the width and height back to the $oringial_str ?
Thanks for your help
