Press enter to see results or esc to cancel.

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 = …

Continue reading

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, …

Continue reading

How to open any File in Java

 In this video, I have shown how you can open any type of file using java. Code is shown below. package test; import java.io.File; public class open_file { public static void main(String[] args) { String path = “E:\\jinu.txt”; File file = new File(path); try { if (file.exists()) { Process pro = Runtime.getRuntime().exec(“rundll32 url.dll,FileProtocolHandler ” …

Continue reading

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, …

Continue reading