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 2011
    Posts
    118
    Thanks
    6
    Thanked 0 Times in 0 Posts

    How to assign first item in an array as var?

    Hey everyone,

    I have an array of file names and I need to set a var as the first filename then when this is next called pass the next filename down into the var and so on.

    Is this possible?

    Thanks

    Josh

  • #2
    Senior Coder kbluhm's Avatar
    Join Date
    Apr 2007
    Location
    Philadelphia, PA, USA
    Posts
    1,509
    Thanks
    3
    Thanked 258 Times in 254 Posts
    Are you talking about iterating over the array?
    PHP Code:
    foreach ( $files as $file )
    {
        
    var_dump$file );



  •  

    Posting Permissions

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