How to realize the automatic conversion of key name types by php
Editor to share with you php how to achieve automatic conversion of key name types, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
Automatic conversion of key name types
$arr = array (1 = >'a', / / 1 key name is integer type, will not automatically convert'b' = > 'bails, / /' b' keys to string type, will not automatically convert'8' = > 'ccharacters, / / 8 strings containing legal integer values will be automatically converted to integer type 3.5 = >' dashes, / / 3 keys will be floating-point types, decimals will be excluded Converted to integer type true = > 'eBay, / / 1 key name is Boolean type, true is converted to 1 null false to 0 null = >' fallow, / /''key name is NULL type, it will be converted to''g' / / 9 without specified key name, default is the value with the most healthy name + 1) $arr [] = 'hashes; / / 10 adds a new healthy value pair without specifying a key name. The default is + 1print_r ($arr), which already has the maximum healthy name; / / printf_r () is a special function for array output. Above is all the contents of the article "how to achieve automatic conversion of key name types by php". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!