phpmady Posted February 7, 2011 Share Posted February 7, 2011 Hi, I assigned a project where i have to import the mobile numbers from the file, but i have no idea how to proceed this. What kind of file to accept as input and how to read. Thanks Link to comment https://forums.phpfreaks.com/topic/226954-import-file-and-read-the-contents/ Share on other sites More sharing options...
beegro Posted February 7, 2011 Share Posted February 7, 2011 You can just import the file and then parse it. I suggest using XML because it's human and machine readable. So if you have an XML file with the numbers you can do the following: $filename = "/some/file/location/file.xml"; $contents = file_get_contents($filename); $results = SimpleXML($contents); // take a look at your data print_r($results); Link to comment https://forums.phpfreaks.com/topic/226954-import-file-and-read-the-contents/#findComment-1170967 Share on other sites More sharing options...
phpmady Posted February 7, 2011 Author Share Posted February 7, 2011 Thank you, that means restricting other file types Thanks Link to comment https://forums.phpfreaks.com/topic/226954-import-file-and-read-the-contents/#findComment-1170972 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.