How to use array_column () of PHP
This article mainly explains "how to use PHP's array_column ()". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to use PHP's array_column ()".
1, convert an int class list to a comma concatenated string
Ints = [str (int) for int in ints] str_of_ints = "," .join (string_ints)
2. Implement the array_column () method of PHP
A = [{"id": 1, "name": "Aaron"}, {"id": 2, "name": "Bob"}] dict (list (map (lambda x: [x ["id"], x [name "], a) / / id= > name dictionary {1: 'Aaron', 2:' Bob'} dict (map (lambda x: [x [id"], x], a)) / / id= > {"id": X Dictionary of "name": "xxx"} {1: {'id': 1,' name': 'Aaron'}, 2: {' id': 2, 'name':' Bob'}}
The division in 3.x and 2.7 is not the same.
A = 23x10 / / the result in 3.x is 2.3a = round (float (23) / 10,1) / / the method of obtaining floating point quotient (keep 1 decimal place) in 2.7.Thank you for your reading. this is the content of "how to use PHP's array_column ()" after the study of this article. I believe you have a deeper understanding of how to use PHP's array_column (), and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!