How to obtain the secret value from the array _ PHP Tutorial

Source: Internet
Author: User
How to extract values from arrays. How to solve the problem by using the values in the array, such as selectcount (*)..... the result should have only one value. now there is only one value in an array. how can we get it?
How to extract values from Arrays
Solution
For example, select count (*)... the result should have only one value. now there is only one value in an array. how can we obtain it?
Prerequisites: You do not know the array key name and cannot use a digital index.


Reference answer
Array_values
Reference answer
Take a look at the usage of mysql_result () in the manual. it is more convenient to use a single value.
Reference answer
The original post published by xdedevil at [url = http://bbs.111cn.cn/redirect.php? Goto = findpost & pid = 812883 & ptid = 100203] link Mark [img] http://bbs.111cn.cn/images/common/back.gif?/img=#/url]
Array_values
The returned value of this function is array, and the value is not directly obtained.
Reference answer
I don't know what to say ,,
Reference answer
Mysql_fetch_row ()//
$ Arr [0];
?>

Do not forget: mysql_fetch_row usage ..
Reference answer
Current
(PHP 3, PHP 4, PHP 5)

Current -- returns the current unit in the array.
Description
Mixed current (array & array)
Reference answer
Original post published by Yu An on [url = http://bbs.111cn.cn/redirect.php? Goto = findpost & pid = 812910 & ptid = 100203] link Mark [img] http://bbs.111cn.cn/images/common/back.gif?/img=#/url]


Do not forget: mysql_fetch_row usage ..
Unfortunately, mysql is useless.
Reference answer
The original post published by ddm at [url = http://bbs.111cn.cn/redirect.php? Goto = findpost & pid = 812916 & ptid = 100203] link Mark [img] http://bbs.111cn.cn/images/common/back.gif?/img=#/url]
Current
(PHP 3, PHP 4, PHP 5)

Current -- returns the current unit in the array.
Description
Mixed current (array & array)
Thank you very much for asking for this baby [img] http://www.111cn.cn/bbs/images/smilies/default/loveliness.gif#/img]
Reference answer
There are many methods, such:

Array_shift

Array_pop

This function can all implement the functions you need.

Explain how to solve the logic of values from the array, such as select count (*)..... the result should have only one value. now there is only one value in an array. how can we get it out...

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.