PHP – Multidimensional Array Sort

The given PHP example order any multidimensional array based on a specific field. Code Example:

Read more »

PHP – WordPress – Display Post Views Within Admin Post Columns

The given PHP example will display the post views within admin post columns into WordPress. Code Example:

Read more »

PHP – WordPress – Get the First Image from the Post and Display it.

The given PHP example allows you to automatically get the first image from the current post, and display it into WordPress. Code Example:

Read more »

PHP – WordPress – Hide The Front-End Dashboard Bar

The given PHP example helps you to hide the Front-End dashboard bar from WordPress. Place this in your index.php before wp_footer() is called. Code Example:

Read more »

PHP – WordPress – Change Login Logo and Login Link

The given PHP example helps you to change the login logo and the login link into WordPress. Code Example:

Read more »

PHP – WordPress – Remove Attribut Title in Link

The given PHP example remove the attribute title in a link into WordPress. Code Example:

Read more »

PHP – WordPress – Get URL Thumbnail

The given PHP example get the thumbnail URL in WordPress. Code Example:

Read more »

PHP – WordPress – Add Class for Image in Content

The given PHP example adds a class to the standard classes in Images in Posts/Pages in WordPress. Code Example:

Read more »

PHP – Highlighted PHP code in output

highlight_string is use to highlight the given php code use the color defined in built in syntax. This function has two parameter: First: the string Second: the bool ture or false If return is set to TRUE, returns the highlighted code as a string instead of printing it out...

Read more »

PHP – URL Validation – Regular Expression

<?php $url = $_REQUEST; if(!preg_match("#^http(s)?://+\.{2,4}#i",$url)){    echo "invalid url"; } else{    echo "valid url"; } ?>

Read more »

PHP – CAPTCHA

PHP – CAPTCHA

A CAPTCHA is a challenge response test used on computers to check if the user is human. A common kind of CAPTCHA that is used on websites requires that the visitor type the letters and numbers of a distorted image. This method is based on the fact that is...

Read more »

PHP – File Delete

The unlink function is use to delete a file physically. The unlink function has one parameter which is the name of the file, if file exist in the same directory, where you want to execute the unlink code then you just give the name of the file, and if...

Read more »

PHP – File Write

The fwrite function is use to write the contents on a file. It has two paramaters. First, is the file handler Second, is the string of data that is to be written PHP Code: <?php $file = fopen("test.txt", 'w') or die("can't open this file"); $contents = "Welcome in PHP\n";...

Read more »