SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Guru
    Join Date
    Dec 2005
    Posts
    964
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Gettin parameters from array?!?

    I have an array that looks like this when I print_r($mytest);

    PHP Code:
    Array ([0] => Array ([test1] => 1st test[test2] => 2nd test)) 
    My question is how to get out only test1 instead of the whole array?

  2. #2
    SitePoint Member
    Join Date
    Jun 2007
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    $mytest[0]['test1']

    left of the => is the key, which is what you refer too inside the brackets

  3. #3
    SitePoint Guru
    Join Date
    Dec 2005
    Posts
    964
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ChrisNewton View Post
    $mytest[0]['test1']

    left of the => is the key, which is what you refer too inside the brackets
    Thanks man... Just what I needed :-)


Bookmarks

Posting Permissions

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