GIDForums  

Go Back   GIDForums > Computer Programming Forums > MySQL / PHP Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 15-Mar-2004, 08:58
nniehoff nniehoff is offline
Member
 
Join Date: Aug 2001
Location: US
Posts: 115
nniehoff has a spectacular aura about

Odd Variable Issue


It has been a long time since I have posted here but I have an interesting issue. I am working on a php script that I wrote and have used for some time. Today I added an array just like normal but when I try to do anything with the array it won't work. See below for the code.

Code:
$registration_dates = array ( # this is an array containing the cutoff date for the current event 'deadline_year' => 2004, 'deadline_month' => 4, 'deadline_date' => 15 );

I thought maybie it was the integers but it's not I tried strings to I can't even echo part of the array to the string. I guess maybe its just monday. Any ideas?

Nick
  #2  
Old 15-Mar-2004, 09:18
nniehoff nniehoff is offline
Member
 
Join Date: Aug 2001
Location: US
Posts: 115
nniehoff has a spectacular aura about
Solved my own problem. I am used to using perl not php so I assumed global variables live tell the end of the program. I guess if you enter a function you must pass variables to it, the global variables are inaccessable here.

Nick
  #3  
Old 16-Mar-2004, 07:12
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough
Hey Nick, it's been a WHILE...

Sorry I couldn't help you sooner but these days, I only have a couple of hours per day to do stuff online.

BTW, you can also use $GLOBALS['variable_name'] inside functions to access variables that were created outside. It's just another way (which is useful to know), so don't take it as a recommendation, suggestion or anything like that...
 
 

Recent GIDBlogA Week in Kuwait by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Issue with stacks CronoX C++ Forum 10 10-Mar-2004 14:30
Having problems displaying a line of variable length using winio. warny_maelstrom C Programming Language 8 15-Feb-2004 11:56
Keeping track of a private variable outside the class viperv80 C++ Forum 1 03-Dec-2003 17:25
setiosflags issue dcj1978 C++ Forum 1 08-Aug-2003 05:16
Php bbcode issue Caged MySQL / PHP Forum 3 06-Aug-2003 18:55

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 00:41.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.