Need php help Remove images by size

kaidoristm

BANNED
Joined
Feb 13, 2009
Messages
564
Reaction score
732
So im not very good with php still learning:) so could use some help here.
So question is how to remove image if image size is smaller than 10x10 px ?
 
SO managed to strip out all tags like this
PHP:
 <?php
$string = preg_replace("/<img[^>]+>/i","",$string);
?>
It removes all image tags what i want is to remove only those tags with attribute width="1"
 
Last edited:
Almoust got it
PHP:
<?php
$string = preg_replace("/<img width\=[\"]1[\"][^>]+>/i","",$string);
?>
but there is small problem with this version it removes image only then if width is right after <img
 
Last edited:
Isnt that great thread ill ask myself and ill answer myself :)
Finally i got it thanks everyone for answers
PHP:
<?php
$string = preg_replace('/<img[^>]+width="1"[^>]*>/i', null,$string);
?>
 
Back
Top