PHP function split $ str = "0791280266601-5011 ";
Print_r (explode ("-", $ str ));
Display effect: Array ([0] => 0791280266601 [1] => 5011 );
========================================================== =
First, how do I get the "0?
2 [1] how to get it? It's split now, but I don't know how to get it?
Prawn for advice
Reply to discussion (solution)
$ T = explode ("-", $ str );
Echo $ t [0];
Echo $ t [1];
$ T = explode ("-", $ str );
Echo $ t [0];
Echo $ t [1];
------------------------------
You just removed the horizontal bar. I want to go to the front of the horizontal bar and the numbers below it.
Your output: 07912802666015011 is wrong
What I want is: 0791280266601
The following result: 5011
Can an adult reply to the moderator meet what you want?
Can an adult reply to the moderator meet what you want?
--------------------------------------
What I do now is:
$ Str = "0791280266601-5011 ";
Print_r (explode ("-", $ str ));
Display effect: Array ([0] => 0791280266601 [1] => 5011 );
I just want to get the value of Array ([0] => 0791280266601 [1] => 5011); [0] in it
$ Str = "0791280266601-5011 ";
$ T = explode ("-", $ str );
Echo $ t [0]."
";
Echo $ t [1];
Output
0791280266601
5011
$ Str = "0791280266601-5011 ";
$ T = explode ("-", $ str );
Echo $ t [0]."
";
Echo $ t [1];
Output
0791280266601
5011
Thank you. I'm stupid. thank you.