Created
November 20, 2017 18:02
-
-
Save ulyssesr/3efdccce8eefc3a8a22a0e54476bdf61 to your computer and use it in GitHub Desktop.
Read string in file and place in array
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$file = file_get_contents("filename.txt"); | |
$data = preg_replace("/[^A-Za-z0-9 ]/", '', $file); | |
$result = preg_split("/[\s,]+/", $data); | |
echo $result[1]; | |
echo $result[2]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment