Featured
-
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 -
Best 5 Lightweight PHP Frameworks for REST APIs Development
Are you ready to develop the Rest AP
by ankur.kumar -
PHP: Full-Stack Framework vs Micro Framework
A web framework can be described as a software fra
by ankit.bhatia -
How to get facebook profile picture by Facebook App
If you would like to get your profile picture in f
by vivek.rastogi -
Creating RESTful API in cakephp
This tutorial will help you to learn how to create
by pushpendra.rawat
Tags
What is process to unlink a directory in PHP ?
Hi Reader's,
Welcome to FindNerd, today we are going to discuss how to unlink a directory by using PHP ?
The unlink() function is used to deleted a file.unlink() function returns TRUE on success and FALSE on failure.
syntax of unlink(...
How to get filetype from a filename?
To get a filetype from a filename we have define a function GetFiletype() in which we have a passed a parameter i.e.,the name of the file. Using this function we will extract the '.' operator from the filename and use the extension to get filetyp...
How to check validate url in php ?
Hi Reader's,
Welcome to FindNerd, today we are going to discuss how to check validate url in php ?
If want to check validate url in php then you can use FILTER_VALIDATE_URL.This is filter validates a URL.
you can see below example
&...
What is process to get the vedio views from youtube using API in PHP ?
Hi Reader's,
Welcome to FindNerd, today we are going to discuss how to get the video views from youtube using API in PHP ?
If you want to see the total counts of a views on youtube video by api, then you should use below code:
<?php...
How to resize image in codelgniter
Hello Friends,
Generally we resize image after uploading. If you are looking to resize image with codelgniter. Please follow the code below:
// Include gd library
$config['image_library'] = 'gd2';
// Define your source image path
$co...
Calculate sum and product of all values in the array
Many times we need to calculate sum or product of values stored in an array. The most common way is to calculate sum or product by using for or foreach loop. For example we have an array with some numeric values, now we want to calculate the tota...
How to validate IP Address using PHP Filter Extension
Hello readers, In this blog I will guide you "To validate IP Address using PHP Filter Extension".
The below code validate your IP Address is valid or not using filter_var() function.
<?php
$ipAddress = "107.20.120.5";
if (...
How to add a Favicon to your Wordpress Blog
Many of the wordpress themes are having options in admin panel for uploading and changing the favicon image. But if we want to make a custom favicon image or we do not have any option in theme then we can create a custom favicon for every wordpre...
How to get current working directory in php ?
Hi Reader's,
Welcome to FindNerd, today we are going to discuss how to get current working directory in php ?
So basically The getcwd() function is used for returning the current working directory.
This function always returns the curre...
How to create/modify/expyire a cookie in php
To know what is a cookie and about the optional parameters for the cookie see click the link below.
http://findnerd.com/list/view/What-is-a-cookie/13459/
Here we will see how to create a cookie and modify the cookie and how the cookie exp...
How to upload file in Codelgniter
Hello Friends,
File uploading is very basic component of web-development. If you are new in Codelgniter and want to code for file uploading please follow the below code:
//Configure set the path where the files uploaded will be copied. Make...
How to get Table and Field Information of MySQL database?
To get the table and field information of a table in MySQL using PHP we will follow the steps given below:
Make a connection.
Select a database.
Find the number of fields using the mysql_num_fields().
Then we will print the type, name, le...
How to define pagination in Codelgniter
Hello Friends,
Pagination is the basic component of listing pages. If you are new in Codelgniter and want to use paging in your listing pages. Please follow the below code for the same:
1) Open your listing controller where you want to show l...
How to use opendir() Function in php ?
Hi Reader's,
Welcome to FindNerd, today we are going to discuss how to use opendir() function in php ?
The opendir() function is used to open a directory handle.
The opendir() function always returns a directory handle resource on succe...
How to use is_dir() function in php ?
Hi Reader's,
Welcome to FindNerd, today we are going to discuss how to use is_dir() function in php ?
The is_dir() function is used for checking a specified file in a directory and returns TRUE if the directory exists.
syntax of is_dir...
How to use fstat() function in php ?
Hi Reader's,
Welcome to FindNerd, today we are going to discuss how to use fstat() function in php ?
The fstat() function is used for returning information about an open file.
syntax of fstat() function
fstat(file)
file is a requir...
How to count number of elements in an array
There are two PHP functions count() and sizeof() which can be used to count the number of elements of an array. Both functions can also be used to count the number of elements of multi-dimensional array also. The explanation of these functions ar...
How to use readdir() function in php ?
Hi Reader's,
Welcome to FindNerd, today we are going to discuss how to use readdir() function in php ?
The readdir() function is used for returning the name of the next entry in a directory.
This function returns the filename on succes...
How to display flash messages in Codelgniter
Hello Friends,
If you are looking to set flash messages in Codelgniter framework. Please follow the below code for the same:
1) Open your controller function and put the below code to define flash message
$this->session->set_flashdat...
How to define logout functionality in Codelgniter
Hello Friends,
If you are looking to define logout functionality in Codelgniter. First we will unset the defined session variables then we will destroy the function. After this we will redirect the page in your desirable location. Please follo...
What is a cookie
It is a small file in a text format and it contains no executable code and has all the information in plain text. Browser stores the cookie file in the users work machine. These cookies are sent to the server with each request that follow a set o...
Get result of two arrays into a single array
Hello Reader in this blog you will see how to get result of two arrays in a single array using PHP
Array one name information
Array
(
[0] => Array
(
[0] => 125479
...
How to increase or decrease dates in the given dates
Hello Reader's if you have the current date and you want to get some past dates or future dates then here you can see it. PHP offers you to use inbuilt function strtotime.
Lets see how you can adjust the dates with this.
Here you will get the ...
How to remove words which occurs mutliple times in a string using PHP
Hello Reader's If you have a string with words occurs more than two times then here you can see how to remove them as a single.
Lets see the string below full of random words and 34 is repeating.
$mystring = '2,34,two,findnerd,logic,66,34,5...
How to find words from a text file using PHP
Hi if you have a long text file full of line and you need to search some text in it then you can use this function. This function will accept the words from user then search from a text file and return the lines which have matching words.
<...
Object casting in PHP
Hello Reader's if you need to cast the objects in PHP then this blog is helpful to you .
Here below I created a function which will cast the object and relocate the object to location as you define
function cast($destination, $sourceObject)...
How to get Tree structure for array in php
Hello reader's I have created a conversion format that can convert array in tree structure.
In this code i use while loop but you can either use the recursive also. So here is the function as below:-
function treeze( &$a, $parent_key, $ch...
How to include file only on specific page in wordpress
Hello Friends
This is a good practice if we include only essential files on every page like I have implemented dropbox on a particular abc page and this idle to include this file only on abc page or where it is require. Please look at the belo...
How to send SMTP email with gmail account
Hello Friends,
If you are looking to implement SMTP email via gmail account. Please follow the below code:
$mailObj = new PHPmailObjer;
$mailObj->SMTPDebug = 3; //SMTP debugging on.
$mailObj->isSMTP(); ...
password encryption in joomla 3.2.1
Hello Readers,
Default user class in joomla has not provided salted MD5 to hash the password. So In joomla 3.2.1 The bind function of the User class now provides the facility to calls JUserHelper::hashPassword($array['password']) to encrypt t...
how to import jquery in joomla
Hello readers, today I guide you "to import jQuery in Joomla"
This can be a rule which we all utilize to guarantee that only 1 content involving jQuery can be imported. The idea merely tests to see in the event jQuery is already been imported...
native session driver in laravel
The native session drivers not require any additional setup. It does not use cookies to store data. Native session drivers use native php mechanism for store session. It use 'NativeSessionStorage.php' for store data.
By using Native session...
Laravel 5.0 handling multiple layouts - Select layout as per the user role
Hi Readers
Recently when I was working in Laravel, I came across an issue. It was regarding the selection of a particular layout as per the logged-in user. I have to show a particular layout according to the role of the user logged-in. When I ...
How to bind a model to a route in laravel
In laravel 5.2 we can bind a model to a route.This model binding is called Implicit model binding
Route::get('/web/users/{user}', function(Post $user) {
return $post;
});
in this case if i use request users/1 it will will inject the...
How to handle large file upload in PHP ?
To handle large file upload in PHP web application, we need to configure PHP.ini file. if you want to upload files greater then 2 Mega Bytes then the default installation of PHP fails. But, we can increase the limit according to the file size wit...
How to Automatically Start XAMPP Server in Ubuntu
Hello Guys,
What is XAMPP ?
As XAMPP is a user friendly application and very easy to install. It contain components like Apache web server application, Mysql Database , PHP and Perl programming support.
In my previous blog post, We d...
PHP script for resize PNG image with transparent background
This article demonstrate a PHP script which can be used to resize PNG image with transparent background. With the script given below we can pass custom width and size for resized image. The script is given below:
<?php
$original_img = ...
How to send sms through Nexmo SMS Gateway in php?
In this post, I will be discussing about how to send SMS through PHP using Nexmo SMS API. To send SMS, we will be using Nexmo SMS API. There are a number of SMS Gateways like Clickatell, Twilio, and so on available in the market. However, I found...
How to Install XAMPP server in Windows PC
Hi friends,
In my previous blog, We learn How to Install XAMPP server in Ubuntu Via Commands, but according to the Dazeinfo more than 80% user was using Windows for their work and entertainment in year 2014. so we come up with a new tutori...
How to use ftp_size() function in php ?
Hi Reader's,
Welcome to FindNerd, today we are going to discuss how to use ftp_size() function in php ?
The ftp_size() function is used for returning the size of a specified file on the FTP server.
This function returns the file size in byt...
How to use filesize() function in php ?
Hi Reader's,
Welcome to FindNerd, today we are going to discuss how to use filesize() function in php ?
The filesize() function basically is used for returning the size of the specified file.
filesize() function returns the file size i...
How to use error_log() function in php ?
Hi Reader's,
Welcome to FindNerd, today we are going to discuss how to use error_log() function in php ?
The error_log() function is used for sending an error message to a log, to a file, or to a mail account.
The error_log() function al...
Random image display in php
You will face any situation in php where you want to display all the images in a random manner. Below is the code which will display all the images in random manner with the help of srand() function which seeds the random generator. It store a...
How to get directory list?
To get directory list in PHP we have define a function get_dirlist() in which we are passing a parameter which is the name of the directory. Inside this function we are executing the ls command with the help of exec() function. Using this we will...
Laravel 5.0 Custom Pagination with the help of Paginator and LengthAwarePaginator
In Laravel 5.0 we have "paginate" in Eloquent by which we can create pagination very easily by just following some simple steps.However there is a drawback with it as it only works if you know all the conditions prior. But what if you want to cre...
How to use reset() function in php ?
Hi Reader's,
Welcome to FindNerd, today we are going to discuss the use of reset() function in php ?
So, basically The reset() function moves the internal pointer to the first element of the array.
syntax of reset() function
reset(ar...
How to use next() Function in php ?
Hi Reader's,
Welcome to FindNerd, today we are going to discuss how to use next() Function in php ?
This function returns the array value in the next place and outputs the next element in the array.
means we can say that it always returns...
How to use get_browser() Function in php ?
Hi Reader's,
Welcome to FindNerd, today we are going to discuss how to use get_browser() Function in php ?
The get_browser() function returns the capabilities of the user's browser.
It looks up the user's browscap.ini file.
syntax of g...
How to add custom meta box for add css in every post?
Hello everyone, In this blog I will guide you "To add custom meta box for add css in every post?"
When we create a Gallery in wordpress normally it comes one by one, in other words all gallery photo are of same height and width. But if you wan...
How to bind a list box to MySQL?
We will understand the process of binding a list box to MySQL by an example. Suppose we have a database "test" having table ex1 which contains columns id,name. We need to bind the name field with the list box. For this we will use the following P...