PHP associative array? Enumerate arrays?

Source: Internet
Author: User
Keywords Php
Please explain please explain please explain

Reply content:

Please explain please explain please explain

  struct {union {long lval;double dval;struct {char *val;int len;} str; HashTable *ht;zend_object_value obj; Value;zend_uint Refcount;zend_uchar Type;zend_uchar Is_ref;} Zval; Php_function (explain) {Zval *uservar;if (zend_parse_parameters (Zend_num_args () tsrmls_cc, "Z", uservar) = = FAILURE) { Return_null ();} Switch (z_type_p (Uservar)) {case is_null:php_printf ("NULL"), Break;case is_bool:php_printf ("Boolean:%s", Z_lval_p ( Uservar)? "TRUE": "FALSE"); Break;case is_long:php_printf ("LONG:%ld", Z_lval_p (Uservar)); Break;case is_double:php_printf (" Double:%f ", Z_dval_p (Uservar)); Break;case is_string:php_printf (" STRING: "); Phpwrite (Z_strval_p (Uservar), Z_strlen_p (Uservar));p hp_printf (""); Break;case is_resource:php_printf ("RESOURCE"); Break;case is_array:php_printf ("ARRAY"), Break;case is_object:php_printf ("OBJECT"); break;default:php_printf (" Unknown ");} Return_true;} 

PHP does not have an array, is actually used by the Hashtable, the name of the array is misinformation, like the world has no road, the number of people to go to the place called the road

I only know PHP inside:

    • indexed array [1,2,3,6,6,90]

    • Associative array [' a ' = = 1, ' b ' and ' = 9, ' f ' = = Ko]

An enumerated array in PHP is also referred to as an associative array, and the subscript of an associative array is that the key value can be unordered, usually a string type;
array('one'=>'1','three'=>'2', 'fore'=>'3');

The subscript (key) of an indexed array is ordered and generally int type, such as:
array('one', 'two', 'three')
The default subscript for this array is 0,1,2 ;(: the subscript of an indexed array starts from 0 by default )

  • 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.