Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 

How to implode multi-dimensional array keys using PHP v5.5

Hello Readers, If you want to implode the array keys from multi-dimensional array then now PHP 5.5 offers you much easier way to do this. Lets see the example as below:- Array ( [0] => Array ( [studenID] =>...

What is process to convert string into an array using PHP ?

Hi Reader's, Welcome to FindNerd, today we are going to discuss what is process to convert string into an array using PHP ? If you want to convert a string into a array then you should use str_split() function let us know how it is works ...

What is process to unzip a file uisng PHP ?

Hi Reader's, Welcome to FindNerd, today we are going to discuss what is process to unzip a file uisng PHP ? If you have a zip file and you want to unzip the file with php, then you should use zip_open(). This is very simple and useful f...

How to use json_decode() function in php ?

Hi Reader's, Welcome to FindNerd, today we are going to discuss how to use json_decode() function in php ? So, Firstly let us know what is the use of json_decode() function ? So json_decode() function is basically used for converting JSO...

Jquery ajax post example with PHP

Hello Readers , If you want to post the form but do not want to refresh the browser then the best approach to follow by using AJAX call . Following is the HTML and Jquery code. HTML: <form id="foo"> <label for="bar">A...

Working example of data by PHP JSON Object

Hello Reader's If you want to know more about the PHP JSON Object then this blog will helps you. Lets see how to handle the working data of it. <?php $trends_url = "http://search.twitter.com/trends/daily.json"; // initialise the sessi...

Remove all special charracters and replace white spaces with hyphen "-" using PHP

Hello Readers! if you want to replace all the sepecial charracters from a string and replace white space by hyphen '-' then the code below will help you to learn:- first we will replace all the white space with hyphen "-" from the string fu...

How to make combinations by elements of array using PHP

Hello Reader's If you want to get all elements in the combinations then you can use PHP code to generate it. Lets see the example as below:- function pc_permute($items, $perms = array()) { if (empty($items)) { echo join(' ', $p...

Multuple deletion in Mysql using PHP

Hello Reader's If you want to handle your html form to delete multiple value at once then by using Check box in array you can do it. lets see one example as below:- <?php $sql = "SELECT * FROM guest_book"; $res...

How to get current unix timestamp in PHP

Hello Reader's if you want to get the current time stamp of Unix in PHP, Then PHP offers your to use this by getTimestamp(). Now let's see this in the example below:- <?php $date = new DateTime(); echo $date->getTimestamp(); ?> ...

How to find elements from the group array in PHP

Hello Reader's! if you have set of arrays and you want to get all of them seperatly then the code below will help you. Let's say if you have [ [a], [b], [c], [a, b], [a, c], [b, c], [a, b, c] ] and you want this [a,b,c] The c...

File upload in PHP.

Hello Reader's , While building any appication we definatley requires images to upload like profile image , company image etc , for this we require php file upload code . You will get image data in array i.e. image name , temp name , image...

How to crop images in PHP

Hello Reader's if you want to crop the images and save them then you can use this code liberay, its a very easy to implement and very useful for thumbnail generation <?php $targ_w = $targ_h = 150; $jpeg_quality = 90; $src = 'demo_files...

Less than equal to query in codeigniter

Hello reader's If you are using codeigniter and want to make '<=' mysql query then you can use the code syntax as below:- ->select('COUNT(payment.keyid) AS rec_count') ->where('payment.paymentdate >=', $month_start) ->where...

What is the use of the @ symbol in PHP ?

Hi Reader's, Welcome to FindNerd, today we are going to discuss what is the use of the @ symbol in PHP ? so basically @ symbol is an "Error Control Operators" and it's works only on expressions. In other word we can say that this symbo...

How to extract a number from a string in PHP ?

Hi Reader's, Welcome to FindNerd, today we are going to discuss how to extract a number from a string in PHP ? If you just want to filter the numbers out, the easiest is to use preg_replace() function. It is very simple and easy function ...

How to use json_encode() function in php ?

Hi Reader's, Welcome to FindNerd, today we are going to discuss how to use json_encode() function in php ? So, Firstly let us know what is the use of json_encode() function ? JSON stands for JavaScript Object Notation. json_encode() is ...

What is the use of fgets() in PHP ?

Hi Reader's, Welcome to FindNerd, today we are going to discuss what is the use of fgets in PHP ? Firstly let us know what is fgets() The fgets() function is used to return a line from an open file. syntax of fgets() fgets(file...

How to set different menu for different page in wordpress

We can set different menu links for every page in wordpress. Sometimes we get the requirements from the client to have different menu links for every pages. It can be done, Its quite coding part. For each pages we have to set different menus from...

How to redirect 404 error page to custom 404 page

When a visitor visits any wrong URL in the site , they see 404 not found error comes from server side by default. We can redirect the visitor from any invalid URL to any of the custom page or any page we want. For the most of the sites , we see t...

How to pass arguments to PHP

Hello Reader's If you have some arguments that you want to pass into function and elements of that array you pass will then be received by your function as distinct parameters. For instance, if you have this function : function test() { ...

How to make conversion of base64 to image using PHP

Hello Reader's If you have some string in base64 and you need them to convert into image file, Then by using PHP you can do this as follows:- function base64Tojpeg($base64_string, $output_file) { $ifp = fopen($output_file, "wb"); $dat...

How upload only max 4 images in PHP?

Hello Reader's if you are developing the website and you want to restrict file upload to max of 4 then you can use the code as below:- The logic for this condition is you just have to return false is count of array is more than 4. Let's see ho...

What is proccess to get the file extension in PHP ?

Hi Reader's, Welcome to FindNerd, today we are going to discuss What is process to get file extension in PHP ? There are many ways for getting the file format or extension of any file. In bellow example you can see how to get the file forma...

What is diffrence between echo and print in PHP ?

Hello all, Welcome to FindNerd, today we are going to discuss the difference between echo and print statement in PHP ? echo and print both are used to printing a statement. So here are few important point given below to differentiate bet...

How to restrict the file type to be upload using PHP

Hello Reader's If you are uploading the attachments with only selected file types then you have to use inarray function. Let's see the example as below:- Put the allowed types in an array and use in_array(). $file_type = $_FILES['foreign_...

How to list the visitor to your website using PHP

Hello Reader's if you want to know the users which are accessing your website then you can get them by their IP. Lets see the example as below:- Try this simple PHP function. <?php function ip_info($ip = NULL, $purpose = "location", $...

How to make PHP page as an image in return

Hello Reader's If you have to return a image from PHP page. then you can use the code as written below:- <?php // open the file in a binary mode $name = './img/ok.png'; $fp = fopen($name, 'rb'); // send the right headers header("Cont...

How to create coma separated string from an array

Hello Reader's if you have an array and you want it to converted into string with separated by coma then by using PHP you can do this as follow:- You have to use Implode function $arr = array(1,2,3,4,5,6,7,8,9); $string = rtrim(implode(...

How to get the name and details of function being called by PHP

Hello Reader's! if you want to get the name of function and method being called, Then by using PHP you can do this as explain below:- Lets's see the example as below:- We use the info provided by a php exception, it's an elegant solution: fu...

How to send email using Wamp server in PHP

Hello Reader's If you are working on your local host and not able to send the email then by configuring your WAMP server you can send email. Let's see how it is done:- First just install Fake Sendmail (download sendmail.zip). Then configure ...

How to pass a variable in jQuery from PHP

Hello Reader's! If you want to send variables from PHP to jQuery then you have to use the selectors:- Lets's see the example below:- This you have to put in the bottom of php page with the selector is "input[type=checkbox]" $("input[typ...

How to select images from database and show on page

Hello Reader's! If you have stored the image in database as blob. Then you need a php code to retrieve them and a html page to show them. Lets see an example below how to show them First create a php page getImage.php and code as written below...

What to you mean by variable $this mean in PHP?

Hello Reader's! If you have any doubt with the $this in PHP then you can see the example as below:- <?php class Person { public $name; function _&#95;construct( $name ) { $this->name = $name; } }; $t...

How to remove extra white spaces from string using PHP

Hello Reader's! if you are dealing with excess whitespace on the beginning or end of the string then you can use trim(), ltrim() or rtrim() to remove them. Also If have to delete extra spaces within a string consider a preg_replace() of multiple ...

How to dynamic generate password in PHP

Hello Reader's If you want to genrate password in PHP then you can use the code as below:- you just have to try this, use strlen instead of count, because count on a string is always 1:- function randomPassword() { $alphabet = 'abcdefg...

How to unlink a directory by using PHP

Hello Reader's If you want to delete a folder and all the files in it then by using PHP recursive function you can do it. Let's see on example as follows:- Before deleting the folder, delete all it's files and folders (and this means recurs...

How to get dates between two given dates in PHP

Hello Readers's if you want to get a recursive set of dates between two given dates, For example 10-12-2105 to 19-12-2015 there are 9 days all will have different dates. By using PHP you can get this as using the code below:- $startTime = st...

Difference between include and require in php

Hello Reader's If you are new to php then you must have to understand the difference between include and require, Lets see some of major difference between them. Using require means your script will halt if it can't load the specified file, an...

How to adjust height of animated GIF file using PHP

First of all you just have to create 3 folder name 1.frame_output 2.images 3.resized_frame_output Now download encoder and decoder class from this below link here. And Download class "GIFDecoder.class.php", Download class "GIFEncoder...

How to convert Image into base64 encoding using PHP

Hello Reader's! If you want to to encode an image with base64 then by using PHP you can do such. You can use the code as below:- This method is very simple and commonly used: function getDataURI($imagePath) { $finfo = new finfo(FILEI...

How to delete characters which can not be printable

Hello Reader's if your page is generating some non readable characters that are not able to print then by using PHP you can remove them as follows:- Many of the other answers here do not take into account unicode characters (e.g. ). In this c...

How you can set multiple checkbox in an array using PHP

Hello Reader's if you want to send the checkbox in post for this you have to pass the form name as an array and afterwards you can access all checked boxes using the var itself which would then be an array. Lets consider the example below:- &...

How to fix HTTP header to UTF-8 using PHP

Hello Reader's If you want to set the HTTP header to UTF-8 then html will itself allows you to convert it. But if you want it to be wrap by using PHP then you can use the code below:- You just have to use header to modify the HTTP header: ...

How to get the text matter from a given PDF using PHP

Hello Reader's, If you want to write a program that takes the matter from a given PDF then now you can use many libraries. These are well function performing and easy to use. Lets see an example below:- Download the class.pdf2text.php from he...

How to get all folders in a given folder using PHP

Hello Reader's! If you want to get all of the folder inside a given directory then PHP offers you many ways to do that, Lets see them from the basic programs. you can use glob() with GLOB_ONLYDIR option here's how you can see how to retrieve...

Difference between PHP $_SERVER['HTTP_HOST'] and $_SERVER['SERVER_NAME']

Hello Reader's! In working PHP you might have seen the two common syntax $_SERVER['HTTP_HOST'] and $_SERVER['SERVER_NAME']. They share similar name but they work different. $_SERVER['SERVER_NAME'] gives the value of the server name as defin...

How to the use file_get_contents() in PHP ?

Welcome to findnerd, today we are going to discuss How the use file_get_contents() in PHP ? Fistly let know what is use of file_get_contents() ? The file_get_contents() basically reads a file into a string. So we can say that file_get_con...

What is procees to print HTML page with tags using PHP ?

Hello all welcome to findnerd, today we are going to discuss How to print HTML page with tags using PHP ? The htmlspecialchars() Function is very useful print HTML page with tags using PHP Firstly let know what does htmlspecialchars() Func...

How to convert given digits to words using PHP

Hello Reader's! If you have given digits of number and you want it to convert into words for example 76 will be converted as seventy six and 102 will be convert as one hundred two Lets see the function below:- <?php function digitti...
1 7 15
Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: