Extract data in php file for database