Help solve the array problem! (Cainiao asked ..) that is to say, the current $ p variable data is 221,567,568,569,572,573,140, 1723, 1724,1725, 1726,1727, 1728,1729, 1730,1731, 1732,1733, 2586,13587 & nbsp; this is echo... how to define an array now .. put the data in the data one by one to help solve the array problem! (Cainiao asked ..)
That is to say, the data of $ p is 221,567,568,569,572,573,140, 1723, 1724,1725, 1726,1727, 1728,1729, 1730,1731, 1732,1733, 2586,13587.
This is from echo...
How to define an array now... put the data one by one into the data...
$ S [0] = 221, $ s [1] = 567 ............
Please help me!
------ Solution --------------------
$ P = "221,567,568,569,572,573,140, 1723, 1724,1725, 1726,1727, 1728,1729, 1730,1731, 1732,1733, 2586,13587"
$ S = explode (',', $ p );
Print_r ($ s );
------ Solution --------------------
$ P = '2017, 1723, 1724,1725, 1726,1727, 1728,1729, 1730,1731, 1732,1733, 2586,13587 ';
$ S = explode (',', $ p );
Print_r ($ s );
-------------------
---------- PHP debugging ----------
Array
(
[0] = & gt; 221
[1] => 567.
[2] => 568.
[3] = & gt; 569
[4] = & gt; 572
[5] = & gt; 573
[6] = & gt; 1408
[7] = & gt; 1723
[8] = & gt; 1724
[9] = & gt; 1725
[10] => 1726.
[11] => 1727.
[12] = & gt; 1728
[13] = & gt; 1729
[14] => 1730.
[15] = & gt; 1731
[16] = & gt; 1732
[17] => 1733.
[18] = & gt; 2586
[19] = & gt; 13587
)
Output completed (time consumed: 0 seconds)-normal termination
------ Solution --------------------
$ P = "221,567,568,569,572,573,140, 1723, 1724,1725, 1726,1727, 1728,1729, 1730,1731, 1732,1733, 2586,13587"
Print_r (split (",", $ p ));
This works too ..
------ Solution --------------------
$ P = "221,567,568,569,572,573,140, 1723, 1724,1725, 1726,1727, 1728,1729, 1730,1731, 1732,1733, 2586,13587 ";
$ S = explode (",", $ p );
-------------
Echo $ s; // output array
-------------
In this way, the data in $ p is saved to the array $ s: $ s [0] = 221; $ s [1] = 567 ......... $ [19] = 13587;
------ Solution --------------------
$ P = "221,567,568,569,572,573,140, 1723, 1724,1725, 1726,1727, 1728,1729, 1730,1731, 1732,1733, 2586,13587"
$ S = explode (',', $ p );
Print_r ($ s );
------ Solution --------------------
... Upstairs
Explode and the bird function. I'm still using split.
My daily php is disgusting. the same function has N functions.
By the way, we will ask you at 20:30:20 on January 9 ,.
How to output 2000-01-09
Is explode used to separate?
Is there a function similar to datevalue in asp?