PHP uses space to split text into arrays. php reads text files line by line, processes space-separated text, and outputs the method as an array. Text file text.txt content: 1 Field 1 field 22 field 1 field 23 Field 1 field 24 field 1 Field 1 field 2 text and text separated by space PHP use space to split text into arrays
Php reads text files line by line, processes text separated by spaces, and outputs the method as an array.
Text file text.txt content:
1 Field 1 field 2 Field 1 field 2 3 Field 1 field 2 4 Field 1 field 2
Text and text are separated by spaces. php is used for processing and the output is an array. here is the code.
? Output result:
Array ([0] => 1 [1] => Field 1 [2] => Field 2) array ([0] => 2 [1] => Field 1 [2] => Field 2) array ([0] => 3 [1] => Field 1 [2] => Field 2) array ([0] => 4 [1] => Field 1 [2] => Field 2)
In this way, PHP uses spaces to split text into arrays.
This php Tutorial is produced by the JS code station.