Kanha Help Me

Local LAMP Setup In Ubuntu

To install (Apache, PHP, MariaDB, PHPMyAdmin), please open your terminal and follow the below simple steps: First, install apache2 package:sudo apt install apache2 Enable apache service sudo systemctl stop apache2.service sudo systemctl start apache2.service sudo systemctl enable apache2.service Install mariadb server and client sudo apt-get install mariadb-server mariadb-client Enable mariadb server sudo systemctl stop mariadb.service …

Local LAMP Setup In Ubuntu Read More »

Upload CSV File in PHP

 <?php // Load the database configuration fileinclude_once ‘dbConfig.php’; // Get status messageif(!empty($_GET[‘status’])){ switch($_GET[‘status’]){ case ‘succ’: $statusType = ‘alert-success’; $statusMsg = ‘Members data has been imported successfully.’; break; case ‘err’: $statusType = ‘alert-danger’; $statusMsg = ‘Some problem occurred, please try again.’; break; case ‘invalid_file’: $statusType = ‘alert-danger’; $statusMsg = ‘Please upload a valid CSV file.’; break; …

Upload CSV File in PHP Read More »

validate csv file header

 <?php $files = glob(“$PathToCreate$version/*.csv”); foreach($files as $file) { if (($handle = fopen($file, “r”)) !== FALSE) { echo “<b>Filename: ” . basename($file) . “</b><br><br>”; while (($data = fgetcsv($handle, 4096, “,”)) !== FALSE) { echo implode(“t”, $data); } echo “<br>”; fclose($handle); } else { echo “Could not open file: ” . $file; } }?>