PHP Archives

PHP Best Practices

Author - Webner
|
0 Comments
|

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 declare constants as “const”. They both Read more…

Regular expressions in PHP

Author - Webner
|
0 Comments
|

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 match on a string and returns true if Read more…

Convert PDF To Image In PHP

Author - Webner
|
0 Comments
|

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 second step Read more…

PHP: Handle broken image links on a page

Author - Webner
|
0 Comments
|

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 the image in HTML tag like this below Read more…

Laravel Events Introduction With Example

Author - Pawan Gulati
|
0 Comments
|

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 is met like most websites have authentication Read more…

PHP: mysqli_multi_query stops the execution of further MySQL queries.

Author - Ishpreet Kaur
|
0 Comments
|

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 at the backend, but it is Read more…

Methods of Debugging – PHP

Author - Umang Pasricha
|
1 Comment
|

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. print_r() and var_dump() are used Read more…

Paytm gateway integration in PHP

Author - Vikas Dalal
|
1 Comment
|

Paytm gateway integration in PHP

Paytm is a very popular way to make payments these days. To integrate Paytm in our site we need to follow the given steps –

Step 1. First, we need to create an account at https://business.paytm.com/ and get our Read more…

Add Text to Image with Php and Python

Author - Maniraj Singh
|
0 Comments
|

How to add Text to Image with Php and Python

Step 1: Call the python file from PHP with the following arguments.
$ filePathForPython: Specify the location of the python file.
$imageName: Dynamic name of the image.
$ imageText: Text to be written on the image Read more…

Face detection using Laravel

Author - Harpal Singh
|
0 Comments
|

Method of Face detection using Laravel

Laravel is a PHP framework for Web Development. It provides many features to make things easy for Web Development. It also takes care of the security of the application. If you have an intermediate level knowledge of PHPRead more…

Install MPDF 7.x on https://www.ionos.com/

Author - Ishpreet kaur
|
0 Comments
|

How to install MPDF 7.x for PHP version > 5.6 on https://www.ionos.com/ and use in PHP Project?

Since from January 2019, https://www.ionos.com/ has been resisting the use of PHP version 5.6, it is supporting PHP versions >= 7.1 Read more…

Send Emails Using Mandrill

Author - Pawandeep Kaur
|
0 Comments
|

How to Send Emails Using Mandrill

Mandrill is a transactional email platform which was built by Mailchimp. It is used for sending the personalized, one-to-one e-commerce emails, and automated transactional emails like password resets, order confirmations, and welcome messages

Steps:
1. Firstly we Read more…

How to Detect Mobile devices in php

Author - Gopi Garg

Detect mobile device php code

We often need to detect if site visitor is using an iPad, a smartphone or any other mobile device in order to change website appearance and even make it faster by reducing data load. Normally we use the media queries and Read more…

Salesforce SOAP and Bulk API Integration in PHP

Author - Ashish Gautam

Implementing Salesforce SOAP and Bulk API Integration in PHP

Salesforce SOAP API:
Salesforce SOAP API is a coding method to use our Org’s information with the help of inbuilt functions and SOQL query. With the help of these function, we can access or Read more…

Creating custom plugins in wordpress

Author - Mamta Sharma

How to Create a custom plugins in wordpress

What is a WordPress plugin:
A plugin in WordPress is a small software app that can be added to a WordPress site to extend its functionality and to add new features to it without changing its Read more…

Class ‘App\Controller\Aws\S3\S3Client’ not found error in CakePHP 3.*

Author - Kailash Kumar

How to resolve “Class ‘App\Controller\Aws\S3\S3Client’ not found” error in CakePHP 3.*

Problem: Class ‘App\Controller\Aws\S3\S3Client’ not found error occurs when we are trying to create S3Client class object with given code (code copied from github):

$s3 = new Read more…

Using Laravel Eloquent ORM

Author - Umang Pasricha

Introduction to Laravel Eloquent ORM

Introduction:

Eloquent ORM is an Object Relational Mapper that interacts with the database. It is a package separate from laravel so can be used outside the laravel too. It implements active record pattern. Laravel Eloquent ORM uses Object-Oriented Read more…

Sort query result according to search conditions in CakePHP 2.

Author - Kailash Kumar
|
0 Comments
|

How to sort query result according to various search conditions in fetch query of CakePHP 2.

Problem: Priority based sorting of records

Example: Search a string (“Proposalways StudySection”) and display records in following order:

Contain all words (“Proposalways StudySection”) in Read more…

Handle data from .msg file parsed by IndependentSoft’s msg.net package

Author - Varun Chopra

Handle data from .msg file parsed by IndependentSoft’s msg.net package

IndepentSoft’s MSG.NET package is used for parsing of outlook .msg files for reading the contents of file and which can be used to display contents on screen or in our custom viewer Read more…

Salesforce – How to do it right

Author - Varun Chopra

Salesforce – How to do it right

Moving on from managing your customer relationships in a worksheet and deciding to do that in a CRM system like Salesforce is a big step forward. If you have already taken that step and you are a Salesforce customer, congratulations Read more…