Questions about the value of an array

Source: Internet
Author: User
Questions about array Values!
PHP Code
  
   Known quantity group $info=array ();//Output Print_r ($info);//result Array (    [0] = = Array        (            [name] + 8.gif            [MD5] = b68d88dbdfc9d0af2e0bbd85a4ccd28f            [Savename] = 20120602080557_452.gif            [size] = 1            [Type] = = Image/gif            [OriginalHeight] = [            originalwidth] = [    1] = = Array        (            [name ] = 9.gif            [MD5] = 4988f85ebebf82f56d70eeaf39a67016            [Savename] = 20120602080557_776.gif            [ Size] = 2            [Type] = = Image/gif            [originalheight] [            originalwidth] = (+        )


I want to take out the corresponding value of the savename, how to do

------Solution--------------------
PHP Code
foreach ($info as $value) {foreach ($value as $getValue) {echo $getValue [' Savename '];}}
------Solution--------------------
foreach ($info as $v) $temp []= $v [' Savename '];
Print_r ($temp);
------Solution--------------------
It appears that name is similar to the unique field, and you want to remove the Savename field that corresponds to name. If so, you need to receive the Name field value you gave, when you submit it with the Post form.

A two-dimensional array. One foreach judgment is enough.

PHP code
 $a =array (Array (' name ' = ' 8.gif ', ' MD5 ' = ' b68d88dbdfc9d0af2e0bbd85a4ccd28f ', ' savename ' = ' 20120602080557_452.gif ', ' s Ize ' = 1, ' type ' = ' image/gif ', ' originalheight ', ' Originalwi DTH ' = + ', Array (' name ' = ' 9.gif ', ' md5 ' = ' 4988f85ebebf82f56d70eeaf39a67 ') 016 ', ' savename ' = ' 20120602080557_776.gif ', ' size ' = 2, ' type ' = ' imag E/gif ', ' originalheight ' = (' originalwidth '); foreach ($a as $k = = $V) {if ($v [' Name ']===$_post[' yourname ']) {//Make $_post[' yourname ']= ' 8.gif ', output $v [' Savename ']=20120602080557_452. Gifecho ' $v ['. ' Savename '. ' = '. $v [' Savename ']. '  
';
  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.