Array syntax. the returned value of the function is that the array cannot be used directly to retrieve elements.

Source: Internet
Author: User
Array syntax problem, the return value of the function is that the array cannot directly use [] to retrieve elements? Beginner & nbsp; PHP, using & nbsp; 5.3.13. A syntax problem is found during usage. Print & nbsp; explode ('. ', & nbsp; microtime (TRUE) [1]; explode () returns an array. I want to obtain this array syntax directly, the return value of the function is that the array cannot directly use [] to retrieve elements?
The younger brother is new to PHP and uses 5.3.13.
A syntax problem is found during usage.

Print explode ('.', microtime (TRUE) [1];


Explode () returns an array. I want to directly retrieve the second element of the returned value and output it, but php reports a syntax error.
If you first assign the return value to a temporary variable such as $ a, then $ a [1] is okay.
Is it necessary to use temporary variables in PHP? Or what other syntax should I use? Php
------ Solution --------------------
Variable transition must be used before php5.4
Php5.4 and later.
------ Solution --------------------
Php5.4 supports this feature ~

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.