简体   繁体   English

我需要从数组中获取NID

[英]I need to get NID from the array

array(1) { 
            [0] => object(stdClass)#53 (14) 
                { 
                    ["cart_item_id"]=> string(2) "64" 
                    ["cart_id"]=> string(1) "1" 
                    ["nid"]=> string(3) "204" 
                    ["qty"]=> string(1) "1" 
                    "changed"]=> string(10) "1340948878" 
                    ["data"]=> array(3) 
                        { 
                            ["shippable"]=> string(1) "1" 
                            ["restrict_qty"]=> string(1) "0" 
                            ["module"]=> string(10) "uc_product" 
                        } 
                    ["title"]=> string(5) "songs" 
                    ["vid"]=> string(3) "204" 
                    ["cost"]=> string(9) "123.00000" 
                    ["price"]=> string(9) "123.00000" 
                    ["weight"]=> string(1) "0" 
                    ["weight_units"]=> string(2) "lb" 
                    ["module"]=> string(10) "uc_product" 
                    ["model"]=> string(1) "1" 
                } 
        }

Please help how do get only nid value in new variable. 请帮助如何在新变量中仅获取nid值。

get via 通过

$output = $array[0]->nid

access object by -> 通过->访问对象
access array by [index] [index]访问数组

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 从Drupal 6中的节点表获取nid - Get nid from node table in Drupal 6 Drupal node_save不再返回$ nid,所以我该如何获取它? - Drupal node_save no longer returns $nid, so how do I get it? 我需要在一封带有PHP的电子邮件中从我的应用程序中获取一个数组 - I need to get an array from my app in an email with PHP 我需要从数组中获取的信息比我需要获取的信息还低 - Information I need from the array is a level below the information I need to get Drupal将Nid / vid从int转换为bigint - Drupal convert nid/vid from int to bigint 我需要从mysql DB获取数据并将其放入json数组并使用json数组进行文本框自动完成 - i need to get data from mysql DB and put it to a json array and use the json array for textbox auto complete 我有这个数组([0] => 36)从28到58的随机数; 我需要获取该行['36']并将其回显 - I have this Array ( [0] => 36 ) random numbers from 28 to 58; the i need to get that row['36'] and echo it out 需要帮助从数组中获取值 - need help in get values from array 我需要将多个复选框从jquery传递到php,而GET作为php中的数组 - I need to pass multiple check boxes from jquery to php and GET is as an array in php 从表单提交的多维数组,我需要获取数据并将其插入到mysql中 - Multidimensional array from form submit that i need to get the data and insert it into mysql
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM