Jump to content

majortom84

New Members
  • Posts

    6
  • Joined

  • Last visited

majortom84's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. function Counter() { static $count; $count++; return $count; } echo Counter(); echo Counter(); echo Counter(); GOT IT !!! 123
  2. //$count = 0; //static $counter = 0; function Counter() { global $counter; $count = $count + 1; return $count; } echo Counter(); echo Counter(); echo Counter(); got it to ... 111 with this so i hope im getting closer. I will keep at it
  3. Write a function Counter() that keeps track of the number of times it is called. This function should not take any parameters and return the number of times that it has been called. Example: echo Counter();//1 echo Counter(); //2 I think I would go like this... $count = 0; function Counter() { $count = $count + 1; } Is this too simple? Am I doing it wrong
  4. ah I see so.... $arr[9] would be this element
  5. How would you access the number 10 in the $arr array? <?php $val = ‘1.2.3.4.5.6.7.8.9.10.11.12’; $arr[] = array(‘a’=>explode(‘.’,$val)); ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.