PHP loads files into an array. Use the file () function to load the file into an array. Each row in the file serves as an element of the array. Instance: array_file.php: viewsourceprint? 01 .? Php02. $ DOCUMENT_ROOT $ _ SERVER [use the file () function to load the file into an array. Each row in the file serves as an element of the array.
Instance:
Array_file.php:
View sourceprint?
01. 02. $DOCUMENT_ROOT = $_SERVER['DOCUMENT_ROOT'];03.?>04.05. 06. Test Array File07. 08. 09. 10. $peoples = file($DOCUMENT_ROOT.'/test/03/people.txt');11. $count = count($peoples);12. if ($count == 0) {13. echo 'NO peoples pending. Please try again later.';14. }15. for ($i = 0; $i < $count; $i++) {16. echo $peoples[$i].'
';17. }18. ?>19. 20.
The upload () function loads a file into an array. Each row in the file serves as an element of the array. Instance: array_file.php: view sourceprint? 01 .? Php 02. $ DOCUMENT_ROOT = $ _ SERVER ['...