Featured
-
How Regression Testing Detects Integral Errors In Business Processes
Humans are forever changing and evolving and so to
by kristina.rigina -
Get Display Banner Advertising Opportunity on FindNerd Platform
“Do you have a product or service that nee
by manoj.rawat -
Android O Released with Top 7 New Features for App Developers
Android was founded by Andy Rubin, Rich Miner, Nic
by sudhanshu.tripathi -
Top 5 Features That Make Laravel the Best PHP Framework for Development
Laravel is a free open source Web Framework of PHP
by abhishek.tiwari.458 -
Objective C or Swift - Which Technology to Learn for iOS Development?
Swift programming language is completely based on
by siddharth.sindhi
Tags
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...
how can I use php to display question
how can I use php to display question stored in mysql database and choose the right answer for it and give grade if the answer is right and store it back in mysql database (sorry I don't speak English very well )
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 ...
Getting error for using the session variables used in PHP
<?php
session_start();
include_once('config.php');
$user=htmlentities(stripslashes($_POST['username']));
$password=htmlentities(stripslashes($_POST['password']));
// Some query processing on database
if(($id_user_fetched<=$id_...
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...
How to upload image using simle Jquery and HTML5
Hello Reader's!
If you are developing the html5 based ajax image uploader then you can look this jquery as the best and easy to use. Lets see how to upload images
1) include two JS file
<script src="jslibs/jquery.js" type="text/javascri...
How to get the colomn name of table using MySql
Hello Reader's, If you have to get the only names of columns of table then see the code below:-
You can use following query for MYSQL:-
SHOW columns FROM your-table;
Below is the example code which shows How to implement above syntax in ph...
How to check if uploading file is in .csv extension using PHP
Hello Reader!,
If you are looking for verify the uploading file with the correct extension with .csv only. Then you use the PHP code as below:-
$allowed = array('csv'); //you can mentions all the allowed file format you need to accept, like ...
Object Iteration?
In PHP we can iterate any object by using the list of items,for getting list of items we have foreach loop in php. So that there will only the visible properties is being listed.
We have loops concept for iterating throughout data list in php....
How to use $_POST in php.?
$_POST is basically used to accumulate form data after submitting an HTML form .
$_POST is submit data with method="post". $_POST is also widely used to pass variables.
You can see below example of $_POST.
<!DOCTYPE html>
<html&...
What is difference between session_unset() and session_destroy() in PHP -
The functioning part both the syntax will work the same but by inditing session_unset will clears the $_SESSION variable but will not ravage the variables and it will initialize to this stage:
session_unset(); effaces only the variables from s...
How to configure Database in CakePHP
CakePHP database configuration details are in a file that is located at app/Config/database.php.
the database file. You can edit the file in the notepad or sublime and can edit the feilds by which it will be connected to the database.
Here w...