PHP Pointers Problem (While)

Code with C | Programming: Projects & Source Codes Forums PHP PHP Pointers Problem (While)

This topic contains 2 replies, has 1 voice, and was last updated by  ShikhaTan 2 years, 6 months ago.

  • Author
  • #10929


    i’ve problem with PHP. i want learning PHP and i read books, watching tutorials and i wrote this code by myself;

    why this code not working ? please help me.

  • #10930


    Use a foreach loop to iterate through an array…

  • #10931


    you should use foreach to loop over arrays, however, to answer your question as to why your code isn’t working:

    In PHP the integer 0 is falsy, the first element in your array is 0 so the while loop never executes (because the first condition is false), you would need to do a type-sensitive comparison to use while:

    Definitely use foreach though.

You must be logged in to reply to this topic.