In php file: <?php ini_set(‘display_errors’, false); ?> In Htaccess file: php_flag display_errors 0
Php
Get hours, minutes and second of the current time using date function in php
<?php $hours = date(“H”); $minutes = date(“i”); $seconds = date(“s”); ?>
Difference between include and require
require(): It will cause a fatal error and halt the execution of the script if the file not found. include(): If the file not found … Difference between include and requireRead more
Create simple wordpress widget
Take new php file then copy the below code to file and put the file in plugins folder and activate the plugin Now you can … Create simple wordpress widgetRead more
wordpress admin menu page
/* Plugin Name: Simple Admin Menu */ add_action(‘admin_menu’, ‘mt_add_pages’); function mt_add_pages() { add_menu_page(‘Main Page’,’Main Page’, ‘manage_options’, ‘main-page-handle’, ‘main_page’ ); add_submenu_page(‘main-page-handle’,’Sub Page1′, ‘Sub Page1’, ‘manage_options’, … wordpress admin menu pageRead more
Generate random unique value in php
<?php function random_code() { $string = “ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz0123456789″; $randval = ” ; for($i = 0;$i <= 10;$i++) { $num = rand() % 62; $tmp = substr($string, … Generate random unique value in phpRead more