List of deprecated functions php
The following is a list of deprecated functions in PHP 5.3.x. call_user_method() (use call_user_func() instead) call_user_method_array() (use call_user_func_array() instead) define_syslog_variables()...
View ArticlePHP array_walk() Function
array_walk is one of the powerful array function , which is working based on user defined function as an argument. Here is the small example below. <?php function add_string($val,$key,$par) { echo...
View ArticleResetting Magento Admin Password
There are many cases when you forget magento admin password . For security reasons magento stores password inform of MD5 format in database , so you cant get password directly through phpmyadmin...
View Articlehtaccess 301 redirect
When you need to redirect your page based on query string from URL, you can put below code in your .htaccess file ! RewriteEngine on RewriteCond %{REQUEST_URI} ^/array\.php$ RewriteCond...
View ArticlePHP File Upload
PHP allows users to upload images on server as shown below. if (isset($_REQUEST['upload'])) { $filename = $_FILES['filename']['tmp_name']; if (file_exists($_SERVER['DOCUMENT_ROOT'] ....
View ArticleCopy entire contents of a directory into another directory using php
function recursive_copy($src, $dst) { $dir = opendir($src); if (!is_dir($dst)) { @mkdir($dst); } while (false !== ($file = readdir($dir))) { if (($file != '.') && ($file != '..')) { if...
View ArticleSimple Object Oriented example in PHP
class Person { var $name; public function getName() { return $this->name; } public function setName($name) { $this->name = $name; } } function changeName($person, $name) {...
View ArticlePHP Class Constants
class Person { const NAME = "Milap"; const SURNAME = "Patel"; } echo Person::NAME; echo "<br />"; echo Person::SURNAME; Output :- Milap Patel Filed under: php Tagged: php
View ArticleHow MySQL Uses Indexes
Some MySQL index Facts MySQL indexes are used to find rows with specific column values quickly. Without an index, MySQL must begin with the first raw and then read through entire table to find rows. If...
View ArticleWordPress – Use php variables in javascript function
In WordPress , sometimes you need to use your PHP variable into included javascript file. You can use below function for this. wp_register_script( 'myscript', FB_LIKE_PLUGIN_URL . 'fb.js' ,...
View ArticleWordPress – Add pagination in admin listing page
When you need to add pagination in WordPress admin listing, just follow below steps: $page_num = isset( $_GET['pagenum'] ) ? absint( $_GET['pagenum'] ) : 1; $limit = 10; // Number of rows in page...
View ArticleHow to fix 503 service unavailable error in WordPress
Are you facing 503 service unavailable error in your WordPress website? The problem with the 503 error is that, you can not get any sort of idea, why you are getting this error. I will show you how to...
View Article