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 use user defined function in PHP ?
Firstly let us know What is the user defined function in php ?
This function declaration starts with the word "function" and user defined function name is not case-sensitive.
User defined function starts with a letter not a number.
Use...
How to use arsort() function in php ?
What is tht arsort() function in php ?
The arsort() function sorts an associative array in descending order, as reported by the value.
why use arsort() function in php ?
arsort() is fundamentally used when sorting associative array in ...
How to use asort() function in php ?
What is tht asort() function in php ?
The asort() function sorts an associative array in ascending order as reported by the value.
why use asort() function in php ?
asort() is fundamentally used when sorting associative array where the...
How to use implode() function in php ?
What is tht implode() function in php ?
The implode() function basically utilized to join elements of an array with a string. So in other word we can say, it takes an array and returns a string.
syntax of implode() function
implode (sep...
How to use rsort() function in php ?
Let us know What is tht rsort() function in php ?
The rsort() function sorts array in decending order menas highest to lowest.
why use rsort() function in php ?
rsort() function basically used for sorting the elements of the array in d...
How to create Cookies With PHP
Why we create cookies ?
cookie is used to identify any user. A cookie is known as a very small file that the server copy into the user's computer browser. Whenever users request a web page using the same computer , it will send the cookie too....
How to use sort() function in php ?
What is tht sort() function in php ?
The sort() function sorts an indexed array in ascending order means lowest to highest .
why use sort() function in php ?
Sort() function basically use for sort the elements of the array in ascending...
How to use explode() function in php ?
Firstly let us know why we use explode() function in php ?
explode() function basically used for breaking a string into an array in php.
explode() function is binary-safe in php.
explode() function syntex is given bellow:
explode(','...
Two dimensional Array sorting
Here we will learn how we can sort two dimensional array:-
lets take an example :-
<?php
$activities = array (
'1' => array(
'id' => 1,
'time' => "2015-10-22 14:20:00"
),
'2' => array(
...
How to utilize array_values() Function in php ?
why we use array_values() function in php ?
The array_values() function use for returns an array which have all the values of an array.
you can see below example:
<?php
//firstly create a array of a city detail
$Citydetail=array(...
How to use time() Function in php ?
What is use of time() Function in php ?
Php time() function basically use for returns a current unix timestamp. In which, you can utilize the date() function to format it to your desiderata.
You can see below example of time() function...
How to use addslashes() functionin php ?
What is addslashes() function ?
The addslashes() function basically used to returns a string with backslashes before characters that need to be quoted in database queries.
Mostly it is used for predefined characters, addslashes() function i...
How to add custom field in wordpress for category
Hello Reader's! if you are new to wordpress development and need to add more custom fields in category, Then you can learn it from the code below:-
Step:1-
Open the file functinon.php and add the following code in it.
add_action( 'category...
How to use wordwrap() Function in php ?
What is wordwrap() Function in php ?
wordwrap() Function wrap a string into incipient lines when it reaches a concrete length.
So,basicaly use of wordwrap() wraps a string into new lines. wordwrap() include space also.
You can take re...
How To Install Plugins in Cake PHP
There are four ways to install a plugin in CakePHP->
Plugin install through Composer
Manually plugin install
Plugin installed As Git Submodule
By Git Cloning
1- Manually
To install a plugin manually in CakePHP, you just have to m...
How to use trim() Function in php ?
Why we use trim() Function in php ?
The trim() function mainly use for removes the spaces from the beginning and the end of the string.
trim() function will divest and control characters such as :
" " an ordinary space.
"\t" a t...
How to use of "ksort" in php
Firstly we will know what is the use of "ksort" in php
"ksort" is used to sort the array by key and this is useful for associative arrays.
You can see below example for "ksort".
<?php
//suppose we want sort employee age from ...
How to set form action via ajax
Hello Reader's
If you want to make your form reusable and set the action dynamic via ajax, Then you can make the ajax call like in the example below:-
<form id = 'idForm'>
...
</form>
and the script will go like this...
How to utilize use of count() function in php
what is count() function
The count() is utilize to count all data elements in an array, or in other word we can say The count() function returns the number of elements in an array.
You can see below example of count() function.
...
How to use array_search() Function in php
what is array search ?
Array search returns the corresponding key if search is successful and Searches the array for a given value.
You can take reference form below example.
<?php
//firstly create a array
$employeName=array("1"...
How to make lazy load of html page contents using Javascript
Hello Reader's!
If you are looking to make your website pages more dynamic and light that loads the html sections as user scrolls down, Then you can use the code below:-
First thing is to make some corrections on the html page like. you need...
How to fetch data from array using php ?
You can take reference form below example to fetch data from array list using php.
This method is really very easy.
<?php
// you have to Decode the array and store a variable
$GetRecord = json_decode('[{"Name":"Mac","age":"25"},{"Na...
How to make custom logo in admin of Wordpress
Hello Reader's!
If you are new to wordpress and need to set your own logo from admin then you can use the wordpress custom logo management in the code:-
First create of open the file, Functions.php in the root directory.
now paste the code ...
Static method in PHP
When we declare a function as static then we generally get confused about what to use like '->', '::', 'this' or 'self'.
There are something we need to take care of when declaring a function as static:
1: If the variable or method being...
How to check if cookie is enable or not
Hi. If you are looking for code to alert user if his cookies are enable or not, Then look the code as below:-
paste the code in you file
<?php
if (isset($_COOKIE['cookieCheck'])) {
echo 'Your cookie is Enable';
} else {
if ...
Data Validation in Cake PHP
Data validation becomes an important part of any of the application. It helps to make it sure that the data input by the user is proper or not.
Defining the validation rules in any application makes the form handling easier. Validation differs ...
How can I sort one dimensional arrays and data in PHP?
Basic one dimensional arrays
$array = array(3, 5, 2, 8);
Applicable sort functions:
sort
rsort
asort
arsort
natsort
natcasesort
ksort
krsort
These all are the sorting method which will help us to sort an one dimensional array.
What is the difference between client-side and server-side programming?
There are n number of difference between client-side and server-side programming.
The below code is split into two entirely separate parts, the server side and the client side.
|
---------->
...
Where to find error logs in PHP
Hello Reader's!
If you need to access your error log files in php then using Linux you can browser it as follows:-
abhishek@roor /var $ sudo updatedb
[sudo] password for abhishek:
abhishek@roor /var $ sudo locate error_log
...
How to make a quick login page in Wordpress
Hello Reader's!
If you are new to Wordpress and want to make a login custom page, then you can see an example below:-
First you have to create a page on the root, name it login.php
<?php
/*
* Template Name: Sign In
*/
if($_PO...
How to use PHP inside the Javascript
Hello Reader's!. If you having the JS file and you need to do some php coding inside the file, Then you can use the following coding standard:-
<script type="text/javascript">
var jsVvariable = <?php echo json_encode($phpVariable); ?...
Use of $this->set() in Cakephp
Hello Readers ,
In cakephp development framework we will use $this->set() several times .
The set() method is basically use to create a variable in our view file i.e. ctp file .
If suppose we have an array $userprofile and we want to ...
How to replace any string using str_replace function in PHP
Hello Readers ,
While doing web development many times we stuck with the concept of str_replace .
For understanding this, let's suppose we have one email template file stored in project directory and when we going to replace any string dyna...
How to create progress bar for uploading file using PHP
Hello Reader's!, If you are developing the html 5 based form and need to show the progress bar of file uploading then you can use the following code written in PHP and Javascript:-
The PHP html file will be go like this:-
<?php
//get ...
How to make a cookie with no expire lifetime
Hello Reader's If you have writing the code that makes the cookies for valid lifetime then you just need to set big number for it's validity. As the example below PHP code:-
Maximum value: 2147483647
setcookie("CookieName", "CookieValue", ...
How to check if a user has liked your Facebook page or not
Hello Reader's, If you are making the code for facebook page likes details and you want to know if the user has already liked your page or not, Then you can use the following library code for that :-
<html>
<head>
<scrip...
Laravel 5.0 Including Sub View Into Another View
Many times we need some sections of HTML which need to be incorporated in many views and just to reduce redundancy we create separate views for it.
An example to accomplish that is stated below:-
Including other views in other view synt...
Laravel 5.0 Writing Static Query In Laravel
Many times we needs to write static query in Laravel. Some time due to the complexity of the query or sometime due to the MYSQL build in functions not supported in the Query Builder or in Eloquent in Laravel example LPAD. Thus at that time Larave...
PHP Getting Time Elapsed Per Last Comment
Passing date to the function and returning the time passed or elapsed when it was commented/posted. It is very useful when you have comment section in your website and you want to show how earlier comment was posted.
/**
* Creating the dat...
How to get Directory size using PHP
Hello Reader's!, If you are looking for a code that can give the directory size from a given path, Then you can use below library code for both Windows and Linux hosting:-
If on a Windows Host:
<?
$filePath = 'c:/www/myfolder';
...
Laravel 5.0 Giving Alias in routing
In route in laravel we can create alias for a url. Laravel provide us the facility for giving alias for an url. We can use this url alias any where in our view
routes.php
Route::get("admin/department/{id}", ['as' => 'department.edit', 'u...
What is the difference between '|' and '||' operators
Hello Reader's you might have seen the coding standard with the common syntax | and || is used. These are the syntax used for checking the conditions and sub conditions. The first | is called as bit wise Operator. It is used to make the conditio...
PHP :- Scraping Data From Youtube Video URL
You can also get the data i.e title, description, thumbnail_url, etc from the Youtube video url by using following script. Remember you need to put the YOUR_GOOGLE_DEVELOPMENT_KEY which you can generate by creating account in Google Developer Con...
How to enable Socket Transport SSL in PHP
Hello reader's If are using the Windows environment and developing the SSL based websites then you might have to enable the SSL for PHP for the first time. So to enable that you just need to perform the following tasks steps:-
Step1: Renam...
How to get variable with same name in POST using PHP
Hello Reader's if have a html form with the variable of same name then you can get them indevisaly by POST
Change the names of your inputs:
<input name="name[]" value="Address" />
<input name="name[]" value="Number" />
<in...
How to sort an given array by it's any key index
Hello Reader's! if you have an given array on with you want to sort with any selected key index as show below:-
Array
(
[0] => Array
(
[configuration_id] => 10
...
How to extract website tittle using the given URL
Hello Reader's! If you having a set of given url's you need just the title of them, then you can use the PHP code below to extract title
<?php
function TitleURL($YourURL){
$str = file_get_contents($YourURL);
if(strlen($str)>0)...
How to destroy user session automatically in PHP if he don't log out
Hello Reader's!
If you have to destroy or unset the user's session automatic then the better way is to set with time dependency
session_start();
if (!isset($_SESSION['EXPIRES']) || $_SESSION['EXPIRES'] < time()+1800) {
session_destr...
MYSQL, PHP :- Query Concatenating Fields To Make Date And Running Between Query On It
Recently, I faced a problem when the date was saved in different fields month, year and date. I need to club all these fields together and run a between query on it.
Another issue which was there was that Date has '0' contacted if the value ...
How to integrate google reCAPTCHA in your html form?
To integrate reCAPTCHA in your HTML form, you need a public & secret key.
You can get the both keys from this URL https://www.google.com/recaptcha/admin and it will look like
Public Key: 9Madr_cSZZADgLy9zeFTEraGn9ogHhxuh_6pquJUHYyt
...