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

How to get file information using PHP

Hello Reader's If you want to get the full path , name or the directory of a file using php then you can use the code below:- Let's see the example below:- function filePathParts($arg1) { echo $arg1['dirname'], "\n"; echo $arg1['bas...

How to validate url in php

Hello Reader's! If you have a url given and you want to check weather it is valid or not. For example www.facebook.com is a valid but www.fcebook.com is invalid link. By using you can do this by Curl function, Lets see the example below:- f...

How to integrate PHP Mailer

Hello Reader's! If you want to send email some other than php mail then php mailer is the best option. PHPMailer provides an object oriented interface, but in case of php mail() is not object oriented. Let's see how to integarte php mailer funct...

How to maximise the maximum size of POST in PHP ?

Welcome to findnerd, today we are going to discuss How to increase maximum size of POST in PHP ? If you want to increase the size of POST for sending much more POST request, then you have to follow bellow given point. There are 2 different ...

How to pass JavaScript variables to PHP

Many a times we got stuck in a case or situation where we have to pass JavaScript variables to PHP using a hidden input in a form. The solution for this situation is: Solution:We cannot pass variable values from the current page javascript...

Convert one date format into another in PHP

Date play an important role in any project. We have to change date format according to our need. If we are using PHP 5.2 and lower then for changing date format we have to parse the elements (year, month, day, hour, minute, second) manually using...

Login with linkedin in php

Follow the below steps in order to use the linkedin API. Go to the Apps page at LinkedIn Developer Network and login with your LinkedIn account credentials https://www.linkedin.com/secure/developer Click on the Add New Application link...

How to Create and Use Cookies in PHP

Cookies are basically small text files that is stored in browser and it is use for tracking purpose. Cookies are also use for remember me functionalities. Setting Cookies with PHP setcookie(name, value, expire, path, domain, security); ...

How to redirect user with session message in Codeigniter?

Hello Reader's If you want to make user redirect and show him the error message on next page then by using codeigniter you can do by following functions:- Let's say if user input wrong username/password then you'll redirect user by following c...

How to send mail using Codeigniter mail function in php

Hello Reader's! If you are working on PHP framework, Codeigniter then you should learn how to send mail by its functions. CI offers you the best way to configure the email and send the mail and you just have to call it on the place required. ...

How to send attachments in mail using PHP

Hello Reader's! If your mail is contating some attachments then you can use the simplest way to sending the mail with attachments. Lets see the example below:- $email = new PHPMailer(); $email->From = 'you@example.com'; $email->...

How to send mail with multiple CC using PHP

Hello Reader's! If you want to send the mail to multiple CC or BCC then you just have to put the emails separated by coma. Lets see the example below:- First create and string with coma separated cc emails:- $cc = 'abc@gmail.com,zye@yahoo.com...

Static Method in PHP

When you declare class method as static then these method can be called without instantiating of the class . When you declare a method or a variable static then we must use static keyword before declare this and when accessing these method or ...

Extracting Audio only From Video File using FFmpeg command

Hello Readers, FFmpeg is such a command line application tool which provides complete solution for recording, converting as well as streaming video and audio. It is a good command line application tool which convert a video file format in ...

Check username availability on keypress using jquery

Username or email availability or any other types of availability check we can do in this way. When user type on a text box an ajax request has made and check what if its available or not. we only required jquery.js HTML <input type='te...

What is FFmpeg?

Hello Readers, Usually, we need to perform a different tasks/activities with audio/video like video/audio format conversion, resize the video Files, adding poster image to an audio file and so on. Even then we need to knowledge of FFmpe...

How to fetch twitter user feeds using PHP

If you want to display twitter user feeds then use the below code of flow. First of all for user timeline json you have to visit below twitter link. http://dev.twitter.com/doc/get/statuses/user_timeline For detail parameter please visit....

Extract Zip File Using PHP

If we do not have access to shell and we want to extract a zip file then just put the below php piece of code and run. $zipObj = new ZipArchive; $file = $zipObj->open(zip_file_name.zip); if ($file == TRUE) { $zipObj->extractTo('ex...

Cakephp ajax pagination using jquery

Using default pagination helper in cakephp. <div class="paginator"> <?php echo $paginator->first(' First ', null, null, array('class' => 'disabled')); ?> <?php echo $paginator->prev('Previous ', null,...

Upload File using Aajx

Sometime you need to upload the image without refreshing the page , in that case you can upload the image with the help of ajx using FormData Objects . To achieve this lets create a form in HTML to upload the file. <div class="control...

How to fetch data from database in php ?

Welcome to findnerd, today we are going to discuss fetch data from database in php . In this blog you can fetch data from database . Firstly establish a database connection Use the mysqli( ) function to established connection to the MySQ...

Remove duplicate Array from Multidimensional Array with the key defined

Here we will learn that how we can remove duplicate Array from multidimensional Array according to the key in the Array. Lets look at the example below :- Here I have initialized one multidimensional Array, now I would like to remove thos...

How to convert Unix time stamp into date time using PHP

Hello Reader's! If you have the time stamp in unix time and you need to convert them into Date time format Then you can use the diffrent ways of doing this in PHP Let's say the example below:- $timestamp=1455070324; echo gmdate("Y-m-d\TH...

How to get the vedio views from youtube using API in PHP

Hello Reader's If you want o get the total counts of a views on youtube video by api, then you can use the following php code. <?php $video_ID = 'your-video-ID'; //set the id from url $JSON = file_get_contents("https://gdata.youtube.com/f...

How to remove duplicate key values in a Multidimensional array using PHP

Hello Reader's If you have an multidimensional array which you want to sort. Then PHP offers you many ways to do it. Let's see the easiest way to achieve it:- Array ( [0] => Array ( [0] => dave [1] => jones...

How to convert string into an array using PHP

Hello Reader's! If you're having a problem to convert a string into an array then you can use the html entity in php. Let's see the example below:- & then be sure to use html_entity_decode // Input string // $input = 'pg_id=2_parent_...

Best way to send array with URL using PHP

Hello Reader's! If you want to send an array as a Param with the url then you can use the serialize and deserialize option from PHP Lets see the example below:- <?php $array["a"] = "Thusitha"; $array["b"] = "Sumanadasa"; $array["c"] = "L...

PHP date_add() Function ?

The date_add() function is mainly used for adding some days, months, years, hours, minutes, and seconds to a date. Syntax of date_add() date_add(object,interval); you can take belloe example for better understanding: <?php //her...

How to use strtotime() Function in PHP ?

The strtotime() function parses an English textual datetime into a Unix timestamps (the number of seconds since January 1 1970 00:00:00 GMT). Syntax of strtotime() Function strtotime(time,now); you can see belloe example: <?ph...

How to send a mail using php ?

In this blog we will see how to send a "Simple Text Email" ? The Php mail( ) function is used to send Emails in PHP. There are three main parameters we have to pass for sending a simple email and one is optional parameter. There 3 param...

How to use date() Function in php ?

The date() function formats a local date and time, and returns the formatted date string. Basically uses of The date() function formats a local date and time. The date() function returns the formatted date string. syntex of date () funct...

How to check image extension before uploading a image ?

There are many way to check image extension before uploading. But "in_array()" function it is very useful way to check image extension when you are uploading a lots of extensions to validate. if the "in_array()" function fails, this mean c...

Different types of SQL Joins

The SQL Joins are mostly used to combine records from two or more tables in a database for getting data. A JOIN defined as combining fields from 2 tables. There are several operators that can be used to join tables. The opertaors that are used...

How to ignore HTML content with tags using PHP

Hello Reader's If you want to make an function which truncate all the html contents and ignore them then you can uset the Sren Lvborg printTruncated function making it UTF-8 (Needs mbstring) function. It's example as below:- /* Truncate HTML, ...

How to send email using AJAX request?

Hello Reader's If you need to make ajax request that send the email in backgournd page then you can use the code below:- $('#submit').click(function() //specify your selector of form { $.ajax({ url: sendemail.php, // your action...

What is shuffle in PHP

Hello Reader's, If you want to know about shuffle function in PHP then this article is helpful for you. Lets say you want to generate 100 numbers on a random basis, a good way would be to generate an array with the numbers in order, then shuffle...

How to give output an image using PHP

Hello Reader's if you want to give output as an image then you can use the code below:- You can use finfo (PHP 5.3+) to get the right MIME type. $filePath = 'yourfile.ext'; $finfo = finfo_open(FILEINFO_MIME_TYPE); $contentType = finfo_fil...

How to use fgets in PHP

Hello Reader's If you need to read a given file line by line then PHP will offer you to use Fgets to do. Lets see it's example as below:- $handle = fopen("yourfile.txt", "r"); if ($handle) { while (($line = fgets($handle)) !== false) ...

Difference between array_key_exits and isset in array

Hello Reader we almost have header about array_key_exits and isset but you need to know the diffrence between them. Lets take an example below:- array_key_exists will only work when your key have an element and doesnt matter it is null, but is...

How to send an email using Gmail SMTP with PHP

Hello Reader's! If you want send an email with secure SMTP with you should choose google gmail smpt. And the code liberary is here:- $mail = new PHPMailer(); // create a new object $mail->IsSMTP(); // enable SMTP $mail->SMT...

Truncate a given sting just after a fixed count of chars using PHP

Hello Reader's! if you want to short a given string on fixed number of chars then php offers you many ways. Below is one of them, you can use this code for the same. Lets see the example below:- $sting_given = "1234567890134667896abcdtiABCD...

How you can stop the re submit of form using Unique id of form

Hello Reader's!, If you need a nice method to stop the form from again and again submit via refresh, PHP offers you many ways like header redriect or unset the $_POST but a pretty way is to implement a unique ID into the post and cache it in the...

How to unzip a file uisng PHP

Hello Reader's!, If you have a zip file and you need to execute unzip the file using PHP, Then you can use the PHP liberary code below:- // Lets say you have zip file in the same folder of php file. $file = 'file.zip'; // get the absolute ...

How to convert a given XML into PHP array

Hello Reader's!, If you are developing the website that takes input in XML and you want it to convert in PHP, Then you have to use some of the library extensions to do so. Let suppose you have the XML as given below:- <tag1Version="1.0"&...

How to send and email without SMTP using PHP

Hello Reader's! If you are new to php and need to send emails then PHP offers you many ways. But you can use the PHP code below, It's simple and does not use yourSMTP. Create a PHP page sentemail.php <?php if(isset($_POST['s...

How to Work With mkdir() function in PHP ?

The mkdir() function is basically use for making a directory. Syntax of mkdir() function mkdir("dir_name"); You can see below example of mkdir() function. <?php // here call mkdir() mkdir("testdocs"); ?> In the above ...

What is rand() function in php?

The rand() function is used to generate a random integer number. How to use rand() function? Syntax of rand() function:rand(); or rand(min,max); min:- min is use for Specifieing the lowest number that is retuned. Default min is 0. max:-m...

How to use $_Get in php?

PHP $_GET can also be used to collect form data after submitting an HTML form with method="get". $_GET can also collect data sent in the URL. You can see below example of $_Get in php. <!DOCTYPE html> <html> <body> ...

How to upload a file in php ?

When you want to upload your curriculum vitae, Your Profile picture, on the server then you can use File uploading method in PHP. With php concept you can easily upload your resume and any other document. There are tow important propert...

How to calculate number of days between two given date's in PHP

Hello Reader's! If you need to calculate the number of hours or days between two given dates then PHP offers you a lot of ways. But you can perform this task by the following way: Lets see the example below:- //Calculate number of hours betw...
1 8 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: