/ Published in: PHP
These two functions allow you to remove images from html page.
The function returns an array of images with the absolute src and,if there are any, the alt and title attributes.
Arguments to pass to get_images() are $file = html source and $url = the page url.
enjoy
The function returns an array of images with the absolute src and,if there are any, the alt and title attributes.
Arguments to pass to get_images() are $file = html source and $url = the page url.
enjoy
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php function get_images($file,$url){ foreach($regs[0] as $key=>$value){ for($i=0;$i<$count;$i++){ $images[$key]['src']=find_true_path($url,$reg[1]); } }else{ continue; } } if($item!=''){ $images[$key]['alt']=$item; }else{ continue; } }else{ continue; } } if($item!=''){ }else{ continue; } }else{ continue; } }else{ continue; } } } return($images); } function find_true_path($url,$image_location){ return($image_location); }else{ $true_location=''; } }else{ $image_location=$image_location; } for($i=0;$i<$back_folder_count;$i++){ }else{ } } $url = $url.'/'; } $true_location = $url.$image_location; return($true_location); } } ?>