Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jul 2009
    Posts
    195
    Thanks
    26
    Thanked 0 Times in 0 Posts

    array display by var dump

    I was going thru the tutorial in w3schools to refresh my php and for the following

    Code:
    <!DOCTYPE html>
    <html>
    <body>
    
    <?php
    $cars=array("Volvo","BMW","Toyota");
    var_dump($cars);
    ?>  
    
    </body>
    </html>
    
    They say the result will be:
    
    array(3) { [0]=> string(5) "Volvo" [1]=> string(3) "BMW" [2]=> string(6) "Toyota" }
    what are all these numbers there? i mean i understand 3. but what is 1 or 6 or 5 for?

  • #2
    Senior Coder
    Join Date
    Aug 2006
    Posts
    1,267
    Thanks
    10
    Thanked 277 Times in 276 Posts
    In parenthesis are the lengths of the strings.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •