Why can't this string be generated?

 array(1) {
  [0]=>
  array(4) {
    ["id"]=>
    string(2) "30"
    [0]=>
    string(2) "30"
    ["date"]=>
    string(10) "2018-10-14"
    [1]=>
    string(10) "2018-10-14"
  }
} 

to generate a string in the form above, in the debug window of chrome, type

excuse me, what"s the problem?

Dec.10,2021

multiple-line string, it is impossible to recognize it when written in this way.

  • 1-es6 template string:
` array(1) {
  [0]=>
  array(4) {
    ["id"]=>
    string(2) "30"
    [0]=>
    string(2) "30"
    ["date"]=>
    string(10) "2018-10-14"
    [1]=>
    string(10) "2018-10-14"
  }
}`
  • method 2-\ (also note to avoid double quotes):
' array(1) {\
  [0]=>\
  array(4) {\
    ["id"]=>\
    string(2) "30"\
    [0]=>\
    string(2) "30"\
    ["date"]=>\
    string(10) "2018-10-14"\
    [1]=>\
    string(10) "2018-10-14"\
  }\
}'
  • effect

clipboard.png


[{"id":"30","0":"30","date":"2018-10-14","1":"2018-10-14"}]

is that what you're going to say? The format data above you can be generated by throwing it directly to the chrome console

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3aed4-2b9cd.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3aed4-2b9cd.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?