Jump to content

Include File returns 1 from array


Recommended Posts

I am using an include file to store an array sueful to more that one script in my site. When I try checking the array in the include for a value it returns a 1 even though the key does not exist. How can I return a false when the key does't exist?

[color="#0000FF"]include file<?php$build_list['56'] = "AE Building";$build_list['133'] = "Acid House";$build_list['2'] = "Agriculture Building";$build_list['50'] = "Albany Village";$build_list['3'] = "Alumni House";$build_list['48'] = "Animal Behavior Research";$build_list['79'] = "Bancroft Library";$build_list['353'] = "2195 Hearst";?>[/color]include 'buildingarray.php';$photo_file = "Photos/" . $build_list[$show_result['code']] ;if (file_exists($photo_file)){...process code}

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...