Tag: PHP
Fetch Mails from Gmail in Core PHP
Fetch Mails in Core PHP Create an Core php app on console (https://console.developers.google.com). Download Google Client library from the following link (https://github.com/googleapis/google-api-php-client) Download the file of credentials(client_id,client_secret) and put it in the project directory. Create the config file in the
How to get the “To” email address from eml files?
What is an EML File ? EML is an email message file extension (means an email is stored in a file with an extension .eml). This file is in the standard MIME RFC 822 format by Microsoft Outlook Express and
PHP Best Practices
Below are the best practices that should be followed in PHP: 1. define() vs. const In the early version of PHP, one would use define() function to set constants. But with new updates in PHP gained one more way to
Regular expressions in PHP
Regular expressions Regular expressions use arithmetic operators like +,^,- and create complex expressions that can help to validate IP address, email address, telephone no, etc. They save our coding time. Some of built-in PHP regular expressions are: Preg_replace- perform pattern
Convert PDF To Image In PHP
How to convert PDF to image file using PHP? Before installing PDF to Images package, firstly you need to install two PHP extensions Imagick and Ghostscript. Step 1: Install Imagick sudo apt-get install php-imagick Step 2: Restart Apache In the
PHP: Handle broken image links on a page
Broken image link issue While creating a website or any project, we usually need to add some images to it. Suppose we have a Laravel project where we are showing some images from s3 or somewhere else. We may include
Laravel Events Introduction With Example
Laravel Events Events are one of the many powerful features of the Laravel. The event basically means the thing that happens or takes place, especially the one that is important. So, in Laravel’s case, events are triggered when some condition
PHP: mysqli_multi_query stops the execution of further MySQL queries.
The mysqli_query statement Generally, we use mysqli_query to execute Mysql queries in PHP. We can use multiple mysqli_query statements to execute multiple operations like insert, update, and select. Sometimes, we store records in more than one table during save operation
Methods of Debugging – PHP
Methods of Debugging by dumping information These methods are used for debugging in PHP. We can see the variable values in human-readable form on the console and can find errors in case there are issues due to variables incorrect values.