Jump to content

kristallaju

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Everything posted by kristallaju

  1. I tried like this $string= "<img width='1' />"; echo $string = preg_replace("/<img[^>]+>/i","",$string); Works great but removes all images
  2. Figured out that it would be best to remove it still with preg_replace but i wanna to remove ovly images which contain width="1" is it possible?
  3. Still no luck ok maybe some more info would help my script uses simplepie to get content from feed so i need to remove images from cache i just dont get how to do it
  4. Ok basically its great solution but how to put it in my script <?php function rewriter( $body, $case_sensitive=false ) { include "inc/synodb.php"; include "inc/config.php"; include "inc/badword.php"; $synlist=$body; $synchar = array("(", ")", "[", "]", "?", ".", ",", "|", "\$", "*", "+", "^", "{", "}"); $synlist=str_replace($synchar," ",$synlist); $synlist=str_replace(" "," ",$synlist); $my_synlist = explode(" ",$synlist); $body = preg_replace('/[\x00-\x1F\x80-\xFF]/', '', $body); $body = preg_replace('/\b('.implode('|',$badword).')\b/','',$body); if (sizeof($my_synlist)>0) { for($i=0;$i<sizeof($my_synlist);$i++) { $synorand = rand(1,100); if($synorand < $percsyno) { $syn_replace=$my_synlist[$i]; $syn_replace=str_replace(" ","",$syn_replace); $syn_replace=" ".$syn_replace." "; $syn_replace_target=$syndb[$syn_replace]; if(($syn_replace!="")&&($syn_replace!=" ")&&($syn_replace_target!="")) { $body = str_replace($syn_replace,$syn_replace_target,$body); } } } } return $body; } ?> ok i managed to make it remove non acii characters and predefined words but dont get how to get it to work with your script?
  5. Any other ways maybe?
  6. How to remove images with preg_replace by size lets say if image is smaller than 10X10px then it will be removed
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.