|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2001-12-14 14:25 UTC] yohgaki@php.net
[2002-01-05 16:48 UTC] lobbin@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 14 15:00:01 2025 UTC |
Hi Folks! Pls. look at the following problem: I have a database application which returns me up to n datasets containing 40 data fields each. Every field can hold an URL to an image or anything else. To detect if it is an image, I check the image size (which I need anyway) and if the test returns TRUE, then it returns an anchor tag to the calling application. So far so good... It works fine until I have less than 13 sets. If I have more, the PHP parser returns a warning at every include() I use, telling me not beeing able to include the file. Very strange, isn't it? If I don't use the if ($img_size_array = @getimagesize ($image_dir.$input_array[$i]) to check if there's an image or not, the problem doesn't happen. It seems to be a problem of too much errors or warnings (supressed by the '@'). Maybe a stack overflow or something like this? This is the function I use: (p.s.: I already have a workaround, so the problem is not urgent) <? function get_img_tags($input_array) { include ("bcontent.php"); $img_tag = array(); for ($i = 0; $i <= count($input_array); $i++) { $img_sp1 = $img_space1; $img_sp2 = $img_space2; if (preg_match ("(\Apdf)", $input_array[$i])) { $img_tag[$i] = $img_sp1."<a href=\"".$image_url.$input_array[$i]."\" alt=\"".$input_array[$i+1]."\">".$input_array[$i+1]."</a>". $img_sp2; } else if ($img_size_array = @getimagesize ($image_dir.$input_array[$i])) { $img_tag[$i] = $img_sp1."<img src=\"".$image_url.$input_array[$i]."\" ".$img_size_array[3]." alt=\"".$input_array[$i+1]."\">".$img_sp2; } } return ($img_tag); } ?> Kind regards, Ulrich S. Kapp BIGPiNG! oHG Raamkamp 8 22397 Hamburg phone: 0049 40 608892-77 fax: 0049 40 608892-88 eMail: kapp@bigping.de