
PHP Tutorial: How to Check Date is Today Date
Use the following code to check a date whether it is today date.
Use the following code to check a date whether it is today date.
Function the_excerpt() can be used to show summary of article or post in WordPress. As default, the excerpt length is set to 55 words. We can control this length by adding few lines code in functions.php file inside theme folder. Below is the codes to change excerpt length in WordPress. Open File Manager and open…
Guide on this article can be used to post Twitter using PHP. First of all, download source code from http://phpfashion.com/twitter-for-php. Extract downloaded file to your folder. Example: /public_html/twitter-php/. Then we create index.php file with the following code: The first line is to setup variables: username, password, and message. And the next part is to setup…
phpFox is social network web-based application which can be used to build online community. I found this error message when installing phpFox: To fix this problem, edit install/include/installer.class.php Find this line: and modify to this: After that, create new folder: Change the folder permission to 777: After that redo phpFox installation http://domain.com/install/index.php And problem will…
Memcached is free & open source, high-performance, distributed memory object caching system, generic in nature, but intended for use in speeding up dynamic web applications by alleviating database load. First of all, install memcached dan php5-memcached packages: and then make sure memcached is running with this command: Restart apache web server: Check php5-memcached module using…
I found this error message after upgrading PHP 5.1.6 to 5.2.14 The problem happens when there is a mismatch version of php-mcrypt module with php installed in the server. You can check the version using this command line: To fix this error, we have to update php-mcrypt module:
This error message shown up when I tried to draw chart using JpGraph: To fix the problem, edit file gd_image.inc.php inside JpGraph folder, and disable the line start with JpGraphError::RaiseL(25128); in function SetAntiAliasing:
The following function is used to get first image URL from WordPress post. Paste below function on /wp-includes/functions.php file. Now you can show the image using this syntax:
Images as static content on website are usually be cached by browser. Using PHP we can make the image can’t be cached and always loaded from server by putting random number behind the image file. The HTML output will be: The number 1331835943 is generated dynamically by PHP that forces the browser to always load…
PHP has a default memory limit of 8MB which is set in php.ini file. If your .php script exceeds more than the limit it will throw “PHP Fatal Error Allowed Memory Size Exhausted”. To settle this problem, you can add one line code in the beginning of your script: or, add in the following code…