Categories
PHP / MySQL

How to capture screenshot of website with a URL using PHP

In this post, we gonna write a simple PHP script to grab given website URL screenshot. So let’s create an HTML form to collect URL form the user. HTML Form We have just created a simple form with one field called URL and submit button. Submit button is to send the request to the server. […]

Categories
PHP / MySQL

Ajax Login form using PHP and MySQL

Today I would like to show you Ajax login functionality implementation using PHP and MySQL. We gonna use MySQL PDO driver in this tutorial. PDO has a much nicer interface, you will end up being more productive, and write safer and cleaner code. Create Ajax Login Form Login Form Create a file called login_form.php with […]

Categories
PHP / MySQL

Add Watermark on Images using PHP

One of the most common approaches to brand/protect images is watermarking. Here I would like to show you how to use PHP to add a watermark to images. PHP uses its GD library to write text on images using true type fonts. To add a watermark, you need an image and any font with extension […]

Categories
PHP / MySQL

Remove specific value from array using php?

This post shows the possible ways to remove specific element from array based on value of the element. Removing specific value Using array_diff() Using this method we can remove one or more elements where using other methods we can only remove/delete one element at a given instance. Removing specific value using array_search() Using this method […]

Categories
PHP / MySQL

Reading RSS Feed with PHP

This article shows how to read RSS feeds using php script. If you are reading this post you might know about RSS feeds and it’s benefits. It is good to display your blog feeds as like recent articles list to keep people in the loop. As you know RSS feed data is in XML format. […]

Categories
PHP / MySQL

Add text to an image with PHP

In this post I would like to show how you can add text to an image with PHP, GD Library. In this post, we will use an existing image and we will write text on it.The imagettftext() function will be used to write the text to the image. Along with the imagettftext() function , based […]

Categories
PHP / MySQL

Zero Padded Numbers with php?

Today I got a situation where I need automatically zero filled number. I realized it could be done much str_pad. The reason I am writing this post is, I just want to share with my readers. str_pad — Pad a string to a certain length with another string. String pad is used to make a […]

Categories
PHP / MySQL

Flatten Nested Arrays Using PHP

In this post I would like to share with you code snippet, which you can use to flatten nested array into one array with string keys with dot notation. This function takes nested array as input. While working with laravel framework, I found array_flatten() method, this method will also flatten a multi-dimensional array into a […]

Categories
PHP / MySQL

Best way to Insert multiple rows in a table using PHP/MySQL

In this tutorial I will show you ,How to insert multiple rows productively into a table with single SQL Query using PHP’s Iterators.

Categories
PHP / MySQL

How to Comment Your PHP Code?

PHP allows three different methods of formatting comments. Comments are generally known as single line and multiple line Comments.A comment in PHP code is a line that is not read as part of the program. Its only purpose is to be read by someone who is editing the code. Comments are really helpful for us […]

Categories
Design Pattern PHP / MySQL

PHP Design Pattern – Singleton pattern

Knowing about Design patters is very essential in software designing and development, here in this post i am gonna write about singleton pattern, basically it is commonly used most useful well know pattern, it allows(create) only one instance to the given class on your script so we can avoid creating multiple instances. With this pattern […]

Categories
PHP / MySQL

PHP Multidimensional Array Searching

This post is about Multidimensional Array Searching , there is no builtin function in PHP to search Multidimensional Array, we can write our own function using recursive procedure. Here is the Simple recursive function to search value in multidimensional array in php.This function returns key of the matched given value if it is in the […]

Categories
CodeIgniter

Php CodeIgniter Server Side Form Validation Example

Today we are going to learn more about server side validation using php codeigniter framework.Follow the below steps to do the server side validations. Server side validation is most secure way than client side validation, because client side validation can be bypass through script manipulation tools. Below example is simple user login form, We are […]

Categories
CodeIgniter

How to get Facebook Page Albums With PHP in CodeIgniter?

Facebook SDK : Download After Downloading FB SDK, place all files in relevant areas in your Codeigniter application based on the folder names. All you need to do is enter application id and secret id in config file called facebook.php located at application/config/facebook.php. download