Tag Archive For "PHP"
Import excel file which includes multiple sheets using PHP into Mysql Database
In this project we are uploading an Excel file with multiple sheets to MySQL database. We are reading the PHP file with the help of PHPExcel class. The project Structure is as shown below. You can download the complete project here. UploadExcelmysql 1. Create the MySQL table inside be DB. As we are saving the …
PHP Read CSV file and insert 10 million record into MySQL table
Here we are trying to read a CSV file with 10 million records with PHP and insert the values in MySQL table. In the video I have shown step by step how do I added this much records instantly. It took only 15 minutes to insert 10 million rows to the DB. 1. So first …
How to create a CSV file using PHP easily
In this video I have shown how to create a CSV file using PHP. The example is shown with the help of XAMPP server installed in windows 10 PC. The below code can be used to create a CSV file. <?php header(“Content-type: text/plain”); header(“Content-Disposition: attachment; filename=jinu.csv”); echo ‘”jinu”,”jawad”,”one”,”two”‘.”\n”; echo ‘”jinu”,”jawad”,”one”,”two”‘.”\n”;; echo ‘”jinu”,”jawad”,”one”,”two”‘.”\n”;; for ($x = …
Read a CSV file using PHP
In this video,I have shown how to read a CSV file using PHP. 1. Below code can be used to read the CSV file and show it exactly as a table in the PHP page. <?php echo ‘<table border=”1″>’; $start_row = 1; if (($csv_file = fopen(“F:\\readcsv\\country.csv”, “r”)) !== FALSE) { while (($read_data = fgetcsv($csv_file, 1000, …
Writing 10 Million rows to a text file using PHP
In this video I have shown how you can create a text file with 10 million rows in that using PHP. This example is shown in a XAMPP server. Below given code will create the file. <?php header(“Content-Type: text/plain”); header(‘Content-Disposition: attachement; filename=”jinujawad.txt”‘); for ($x = 0; $x <= 1000000; $x++) { echo “The number is: …
Send SOAP Request with custom variables and read XML response from PHP page
In this video I have shown how we can send XML request with custom variables set from a HTML form. The XML Response received is parsed and shown in same page. For testing this, I have found the website holidaywebservice.com which will give response for XML request we send. 1. The Sample XML Request we …
Create excel file in PHP without using any libraries
In this video I have shown you how you can create excel file in PHP without using any libraries. Just add 2 lines of code mentioned below in your php page. The page will create an excel file and download it. header(“Content-type: application/vnd.ms-excel”); header(“Content-Disposition: attachment; filename=chillyfacts.com.xls”); The example page I shown in the video is, …
Send SOAP Request and read XML response from PHP page
In this video I have shown how you can send a XML Soap request and read the XML response with in a PHP page. For testing this, I have found the website holidaywebservice.com which will give response for XML request we send. 1. The below image shows the request and response for a service from …
Convert Image to Text Optical Character Recognition OCR Using PHP
In this video I have shown how you can convert image to text or do Optical Character Recognition OCR using PHP as front end. You can upload the file you want to do the OCR and the result will show on the page itself. First you have to download the tesseract application and install. …
Run command prompt commands from PHP page
In this video I have shown how you can run command prompt commands from PHP page. shell_exec(‘ ‘) can be used for executing cmd commands from php page. The below image shows the ipconfig/all command executed from my pc. We can run the same command from PHP page. The code is as below. <?php $out=shell_exec(‘ipconfig/all’); …