Ask a php array and String Conversion question. I have the following string: {code...} except using the explode function for segmentation, is there any other way to quickly convert it to an array. Ask a php array and String Conversion question. I have the following string:
["Approval", "bbcode", "emoji", "english", "flags", "likes", "simplified-chinese"]
In addition to using the explode function for segmentation, is there any other way to quickly convert it to an array.
Reply content:
Ask a php array and String Conversion question. I have the following string:
["Approval", "bbcode", "emoji", "english", "flags", "likes", "simplified-chinese"]
In addition to using the explode function for segmentation, is there any other way to quickly convert it to an array.
$ Array = json_decode ('["approval", "bbcode", "emoji", "english", "flags", "likes", "simplified-chinese"]', true );
Regular Expressions can be used, but the efficiency should be lower.
$ Str = '"approval", "bbcode", "emoji", "english", "flags", "likes", "simplified-chinese "'; preg_match_all ('/\". [^,] * \ "/', $ str, $ out); print_r ($ out );
You can also write c extensions by yourself. The efficiency should be less than that of explode.