PHP

PHP: Get String After Character

PHP: Mendapatkan data setelah karakter tertentu. $string = ‘ice-bitrate=128’; echo substr($string, strpos($string, ‘=’)+1); sumber: devshed

PHP: Simple Contact Form with Archive Text

You have hosting and you want to make simple web for fast loading instead of full graphic. And web without contact form is like food without salt :D. And here I tried to combine between simple contact form with archive… Baca selengkapnya PHP: Simple Contact Form with Archive Text

PHP: Create a List of Time Zones

Sometimes, you want to create a list of available time zones to prompt your user to select his/her time zone. Fortunately, PHP offers timezone_identifiers_list (PHP 5 >= 5.2.0). You can create your list easily, using a function. Code <?php /**… Baca selengkapnya PHP: Create a List of Time Zones

PHP: Class for Scan Multiple Directories with Recursively and Extensions Filter

Needed something that could return the contents of single or multiple directories, recursively or non-recursively, for all files or specified file extensions that would be accessible easily from any scope or script. <?php class scanDir { static private $directories, $files,… Baca selengkapnya PHP: Class for Scan Multiple Directories with Recursively and Extensions Filter

Random Image Script

Description This is your standard random image script that takes a slightly different approach than most, namely using standard HTTP headers instead of reading the file through the script. Installation/Usage For the simplest possible installation, just drop this code in… Baca selengkapnya Random Image Script

WordPress: A PHP Class which enables you to create/manage/update WordPress posts and pages

WordPress PostController This is a PHP Class which enables you to create/manage/update WordPress posts and pages. This require WordPress 2.9+ to run. Usage Include the class.postcontroller.php file in your WordPress plugin/theme. You now have access to the class and its… Baca selengkapnya WordPress: A PHP Class which enables you to create/manage/update WordPress posts and pages

PHP: __FILE__

Exact meaning of basename(dirname(__FILE__)) in PHP __FILE__ would give something like: “/home/httpd/html/modules/Your_Account/index.php” dirname(__FILE__) gives “/home/httpd/html/modules/Your_Account” basename(dirname(__FILE__)) gives “Your_Account”

Show Total Weight in Woocommerce

Add code below in your theme function, function.php to show total weight in Woocommerce. /** * WooCommerce * ————– * * Display cart total weight on the cart page * */ add_action(‘woocommerce_cart_collaterals’, ‘myprefix_cart_extra_info’); function myprefix_cart_extra_info() { global $woocommerce; echo ‘<div… Baca selengkapnya Show Total Weight in Woocommerce

WordPress: Remove query strings from static resources

This is normal code for remove query strings from static resources. Add the code below to your function.php. function _remove_script_version( $src ){ $parts = explode( ‘?’, $src ); return $parts[0]; } add_filter( ‘script_loader_src’, ‘_remove_script_version’, 15, 1 ); add_filter( ‘style_loader_src’, ‘_remove_script_version’,… Baca selengkapnya WordPress: Remove query strings from static resources

PHP: Difference Between Include And Require in PHP

If the file that you want to include is not found then this function to return a PHP warning, which is different to the require function which will return a fatal error. The require function acts just like the include… Baca selengkapnya PHP: Difference Between Include And Require in PHP

Scroll to Top