Hey,
I have an question for you guys and girls 😛
I have these 2 parts of script wich i want to merge into eachother.
The basic idea is to make images wider than 500 pixels 500 pixels wide. There is no problem if you have a simpel trace but i havent.
I want the following:

converted into:
<img src=http://www.domain.com/imgwiderthan500pix.jpg width=500>
How can i do this ??
$str = preg_replace("/\[img\](.*?)\[\/img\]/ie", "'<img src=\\1 border=0>'", $str);
list($width, $height, $type, $attr) = getimagesize($fotopad);
if($width > 500)
{
$width = '500';
}