FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Dot in array key name
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Dot in array key name [message #169966] Sat, 02 October 2010 06:30 Go to previous message
Martin is currently offline  Martin
Messages: 8
Registered: October 2010
Karma:
Junior Member
Hi.

I'm debugging a script where i load images if they haven't already
been loaded and then draw them onto another image.
(All images are PNGs).

$icons=array();

$icon_name='myicon.png';

if($icons[$icon_name]){
// the image has already been loaded
$icon=$icons[$icon_name];
} else {
$icon=imagecreatefrompng($icon_name);
$icons[$icon_name]=$icon;
}

I'm trying not to load an image more than once if it is required more
than once.

Anyway - i have a bug where sometimes the wrong image is used and
wondered whether the dot in the image's filename is invalid syntax for
an array key name?

I've searched a while but get lots of irrelevant results - if anyone
can give me a quick yes or no answer it'd be appreciated.

Martin.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Inserting into associative array
Next Topic: php ide with checkpoint restart is there?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Wed Nov 27 13:19:09 GMT 2024

Total time taken to generate the page: 0.04441 seconds