I would like to adjust some pictures size. I used this code: <?php preg_match_all('/<img[^>]*width=\"[1-9]\d{2}\" height=\"[1-9]\d{2}\"[^>]*\/>/is', $s, $matches); $firstimg = $matches[0][0]; $newimg = preg_replace('/width=\"\d+\" height=\"\d+\"/', 'width="300" height="200"', $firstimg); echo $newimg; ?> But it can not show all the pictures, when the picture rule is <img src="" alt="" title="" /> There is no width and height, it can not work, how to add a width and height to these kind of pictures? Thanks.
Your better off using the GD library to resize the images in real time rather then pulling and squashing them like that. Read this for more information, http://php.net/manual/en/book.image.php Kind regards, Glen Hughes