Question
How to secretly get values from an array
Solution
For example, select count(*).....The result should be only one value. Now there is only such a value in an array. How to take it out?
Prerequisite: If you don’t know the array key name, you cannot use numerical index
Reference answer
array_values
Reference answer
Please take a look at the usage of mysql_result() in the manual. It is more convenient to obtain a single value.
Reference answer
Original post published by xdevil on 2009-1-2 23:36 [url=http://bbs.111cn.cn/redirect.php?goto=findpost&pid=812883&ptid=100203]Link tag [img]http://bbs. 111cn.cn/images/common/back.gif[/img][/url]
array_values
This function still returns an array, and the value is not taken out directly
Reference answer
I don’t know what to say,,
Reference answer
mysql_fetch_row() //
$arr[0];
?>
Don’t forget: the use of mysql_fetch_row..
Reference answer
current
(PHP 3, PHP 4, PHP 5)
current -- Returns the current cell in the array
Description
mixed current (array &array)
Reference answer
The original post was published by An at 2009-1-2 23:54 [url=http://bbs.111cn.cn/redirect.php?goto=findpost&pid=812910&ptid=100203]Link tag [img]http://bbs. 111cn.cn/images/common/back.gif[/img][/url]
Don’t forget: the use of mysql_fetch_row..
Unfortunately, I don’t use mysql
Reference answer
The original post was published by ddm on 2009-1-2 23:59 [url=http://bbs.111cn.cn/redirect.php?goto=findpost&pid=812916&ptid=100203]Link tag [img]http://bbs. 111cn.cn/images/common/back.gif[/img][/url]
current
(PHP 3, PHP 4, PHP 5)
current -- Returns the current cell in the array
Description
mixed current (array &array)
Thank you all very much, this is what I want [img]http://www.111cn.cn/bbs/images/smilies/default/loveliness.gif[/img]
Reference answer
There are many methods, such as:
array_shift
array_pop
This function can achieve the function you want.