A 400 error is a client-side error that occurs when the server cannot understand the request sent by the client. This can be caused…
The “white screen of death” (WSOD) is a term used to describe a blank page that appears when an error occurs in a website’s…
# php -v (default PHP version) # From PHP 8.0 to PHP 7.4: sudo a2dismod php8.0 sudo a2enmod php7.4 sudo update-alternatives –set php /usr/bin/php7.4…
$uri_path = parse_url($_SERVER[‘REQUEST_URI’], PHP_URL_PATH);$uri_segments = explode(‘/’, $uri_path); echo $uri_segments[1]; // for www.example.com/user/account you will get ‘user’
Run below command in terminal php bin/magento setup:upgrade php bin/magento setup:di:compile php bin/magento cache:flush chmo -R 0777 var/ pub/ generated/
Sorting array value without using built in php like sort() etc Bubble sort in php <?php $array =array(‘2′,’4′,’8′,’5′,’1′,’7′,’6′,’9′,’10’,’3′); echo ‘Unsorted array’; print_r($array); for($i =…
Composer require runs out of memory. PHP Fatal error: Allowed memory size of 1610612736 bytes exhausted To get the current memory_limit value, run: php…
Step 1: Create Database Table CREATE TABLE `info` ( `id` int(11) NOT NULL, `name` varchar(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; Step 2: Create…
<?php $html = file_get_contents(‘https://www.practo.com/search?results_type=doctor’); //get the html returned from the following url $pokemon_doc = new DOMDocument(); libxml_use_internal_errors(TRUE); //disable libxml errors if(!empty($html)){ //if any html…
<?php header(‘Content-type: application/excel’); $filename = ‘filename.xls’; header(‘Content-Disposition: attachment; filename=’.$filename); $data = ‘<html xmlns:x=”urn:schemas-microsoft-com:office:excel”> <head> <title>Page Title</title> </head> <body> <table><tr><td>Cell 1</td><td>Cell 2</td></tr></table> </body></html>’; echo $data;…
https://youtu.be/4p4kI60POYs <?php //index.php $error = ”; $name = ”; $email = ”; $subject = ”; $mobile = ”; $message = ”; function clean_text($string) {…
https://youtu.be/Cw8mCIK2oIY Create index.php file and put code inside of index.php file In this tutorial, we will learn how to data store inside of CSV…
<?php $input= array(10,101,21,01,11,12,12131,14,115,51,51); $count_values = array(); foreach ($input as $a) { $count_values[$a]++; } echo ‘Duplicates count: ‘.count($count_values); print_r($count_values); ?>