Help solve the problem related to the array! (For beginners .)
Source: Internet
Author: User
Help solve the array problem! (Cainiao...) that is to say, the current data of a variable $ p is 221,567,568,569,572,573,140, 1723, 1724,1725, 1726,1727, 1728,1729, 1730,1731, 1732,1733, 2586,13587 & nb to help solve the problem of! (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 );
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?
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.