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
How to disable layout in Zend Framework
Hello Friends,
Some time we need to disable layout of our page. No layout mean no header, no footer, no left bar, no right bar. You want to display the main page content part like if you are using AJAX at that time you need to disable layout f...
What is available by default if you forget to declare in .info file, Durpal 7 Theme
Regions
If you did not mentioned any custom region in .info file the following regoins will be available by default.
Header
Highlighted
Help
Content
Sidebar first
Sidebar second
Footer
features
The .info file is also u...
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 use BREADCRUMB in Zend Framework
Hello Guys,
If you are looking to set Breadcrumb in zend framework. Please follow the below code for the same::
1)Open your controller file and function in which you want to add breadcrumb.
/* BreadCrumb starts Here */
$breadcrumbArray ...
How to set pagging in Zend Framework
Hello Guys,
We generally need paging in all the listing pages in website. To set paging in Zend Framework, please follow the below code::
// you need to set the below code in your controller
$select = $db->select()->from('posts')-...
Customizing an existing theme, Drupal 7
Steps of customizing an existing theme can be broken into three major steps
Select the base theme.
Create a sub-theme from the base theme
Make the changes to the new sub-theme
The relationship between a base theme ...
How to set flash messages in Zend Framework
Hello Guys,
If you are looking to set flash messages in Zend framework please follow the below process::
1) Open your controller and set below line under init()
$this->_flashMessenger = $this->_helper->getHelper('FlashMessenger...
How to check a value exist in array or not
PHP provide a lots of built in functions for manipulation of array. in_array is one of the useful built in function of PHP which is used to check whether a specified value exists in array or not. If the search value found in array the function re...
This version is not compatible with Drupal 7.x and should be replaced.
This version is not compatible with Drupal 7.x and should be replaced.
I created a fresh sub-theme and deleted all the unwanted content and file's from my new sub-theme folder, On appearance page I was unable to enable it as it was showing me...
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...
Setting up a local development server, Drupal 7
Setting up a local development server installing plugins and modules you might need to develop Drupal theme
Firt we need to setup the local sever where we gonna run our Drupal site
1. First we need a server, XAMPP is very popular A...
Intercepting and overriding variables and Making new variables available in Drupal theme
Hold the existing variable and override it
grasp and override the existing variables, to do it we use a function in the template.php file
For example
<?php
function themename_preprocess(&$vars){
$var['title'] = 'your...
how to install xampp in ubuntu 14.04 using terminal (Command Line)
Basically XAMPP is abbreviation of some technical terms like it is Cross Platform(X) Apache HTTP Server (A) MySql(M), PHP(P) and Pearl(P) server. Cross platform means it can run on various platform like Windows, Linux, Unix etc. It is first cho...
Reverse the string without array_reverse function
Welcome to FindNerd. Today we are going to tell the way how we can reverse a string without using array_reverse function in php. Please have a look.
$string = "FINDNERD";
$count=array_sum(count_chars($string));
for($i=$count -1 ;$i>=0;$...
Recursive Function
A function that call itself is known as *Recursive Function*. Recursive function keeps calling itself. We have to set a condition that will stop it, otherwise it will run infinitely. This condition is known as a base case. Basically, base case te...
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 ...
Recursive function in cakephp
Recursive in Cakephp is used to set the depth of result when find() methods are used. It retrieves the records associated with model data.Using recursive we can limit the required data. Lets consider an example of recursive by taking an example o...
How to use "Where clause with multiple attributes" in ZEND Framework
Hello guys if you are looking to use where clause with multiple attribute in ZEND Framework. Please use the below code for the same::
$databaseObj = Zend_Db_Table::getDefaultAdapter();
$selectQuery = $this->select();
$selectQuery->from...
How to use mysql join in Zend Framework
Hello Guys,
If you are looking to use MYSQL join in zend framework. Please use the below code for the same:
$dbObj = Zend_Db_Table::getDefaultAdapter();
$selectQuery = $this->select();
$selectQuery->setIntegrityCheck(false);
$selec...
How to use Select query in ZEND Framework
Hello Guys,
If you are looking to use "Select" mysql query in ZEND Framework. Please use the below code::
$dbObj = Zend_Db_Table::getDefaultAdapter();
$select = $this->select();
$select->from(array('users'),array('count(user_id) as ...
How to set session varible in ZEND Framework
Hello Friends,
If you are looking to save/fetch session variable in ZEND Framework. Please use the below code:
// DEFINE SESSION VARIABLE
$sess = new Zend_Session_Namespace('MyNamespace');
$sess->username = "you_name"; // define your v...
Connect to MySQL in PHP
In PHP, To perform any data task in MySQL database , first we have to connect MySql database to local server
This can be done as :
<?php
$servername = "localhost";
$username = "username";
$password = "password";
// Create connectio...
MVC Structure Flow
The MVC structure breaks an application's interface, into three parts: the model, the view, and the controller. It can be mapped with the traditional input, processing & output roles .
Input --> Processing --> Output
Controlle...
Log cleaning in magento database for site performance
How to Clean log in Magento for database maintenance & site performance ?
Log cleaning gives dramatic improvement in site performance. Manage DB through log cleaning decrease DB size which gives better site performance. There are 2 ways t...
URL rewritting in PHP with .htaccess
Hello Guys,
If you are looking to change your website URLs on SEO friendly mode URL rewriting with .htaccess file is a good practice to do same. Suppose you want to change your website URL like
htttp://www.abc.com/prodDetail.php?prodID=15&am...
Transaction on braintree
Welcome to FindNerd. Today we are going to discuss the creation of transaction. We use the sale function for transaction creation. You need to pass the amount,customer id,
and nonce from client side. Please have a look.
$result = Braintree_Tr...
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 ...
Converting Themeable functoin to templates, Drupal 7
The final option is the creation of individual template files that are dedicated to overriding specific themable functions. This could be very helpful for the designer as PHP developer have done his work and designer now can do this XHTML and...
Token generation in braintree
Welcome to FindNerd. Today we are going to discuss the client token generation on braintree. You can create a unique client tokens for different process. Please
have a look.
public function getBraintreeClientToken($customer_id = null)
{
...
Overriding Theme functions, Drupal 7
Overriding functions
Themable functions can be overridden by copying the functions and placing them in the active theme's template.php file though the template file is optional but this is the only file you can use override the function defied...
Overriding the Default Styling, Drupal 7
Overriding the Default Styling
Three approaches we can adopt to override templates in Drupal 7 Themes
Overriding templates
Overriding functions
Converting themable functions into new template
Theme Registry Plays a vit...
Customer creation on Braintree
Welcome to FindNerd. Today we are going to discuss the customer on braintree. Braintree is a company of paypal which provides different payment tools. You need to
integrate the library of braintree with your project. It is available in differen...
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 disable Updates in WordPress ?
The simplest way to disable word-press updates by installing and activating Disable Updates Manager plugin from the given below link.
[https://wordpress.org/plugins/stops-core-theme-and-plugin-updates/][1]
WordPress updates disable by Manua...
Change time zone in CodeIgniter
Some time developer wants to change the timezone in codeigniter application. There is may way to change the timezone in codeigniter. Here I am explaining you the best way to change the timezone in codeigniter, which is-
First open the index.ph...
What is phpScaffold
phpScaffold
Scaffold is a powerful standalone PHP class that dynamically creates CRUD functionality for a database table. It is designed to dramatically decrease the time it takes to get your database-driven application up and running.
phpSc...
Difference between =, == and === in PHP
In PHP programming, Many times we have seen and used different operators of PHP. This article demonstrate the difference between the operators which looks identical but used for different operations. In PHP we have three types of equal sign (=) o...
How to create log file in PHP
If you want to debug a large amount of data. You need to create a Log file with the following piece of code.
$file = fopen ( "testfile.txt" , "a+" );
fwrite ( $file , serialize ( print_r ( $_POST , true ) ) );
fopen(): It is inbuilt func...
Time Zone Function in PHP
If your server is on a different location and you need a synchronization with it to get in the proper time. Then you need to get the correct time according to that specific location.
To do so the timezone to the specific location.
This can be...
Date and Time in PHP
The date function in PHP is the one which formats the timstamp to a readable form.
The Syntax of it is as :
date(format,timestamp)
The required format function is to specify the format of the date and the timestamp Specifies default curr...
how to read single line and character from a file?
Read Single Line: fgets()
To read a single line from a file fgets() function is used.
For example: Suppose we have a file 'demo.txt'. The script given below results the first line of the file:
<?php
$filename = fopen("demo.txt", "r") ...
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...
jQuery Ajax in cakephp
We can implement jquery ajax by this way
$this->layout = 'ajax';
Call above line in your function inside your controller file. by this way we can call the ajax layout.
Need to create a ajax.ctp file which is empty layout file.
...
Encrypt and Decrypt password in php
We can easily encrypt and decrypt the password in php using the code below. First need to create key and string and pass it on to the encrypt function which are given below for encryption.
$key = 'password for encrypt or decrypt';
$string = ...