PHP: Format integer into number of decimal places
Previous I have written an article about formating interger into number of decimal places in Java. The main reason to store money value in integer in to prevent loss in precision. For example the actual value for 12.33 in float could be 12.3333333333...; while 1233 in integer is always 1233.
Today I will be showing you the same code but in PHP language. I know you can do the same thing with PHP's number_format(), but you will need to cast the integer into float first before past the money value into the number_format() function. Therefore there are possibles of lose in precision.
PHP: session_start() – No such file or directory error
Have you encountered the following PHP error (or something similar) before in your Windows Vista?
Warning: session_start() [function.session-start]: open(C:\Users\YOURNAME\AppData\Local\Temp\php\session\sess_ficdel21e6lupsojqdk62ofts5, O_RDWR) failed: No such file or directory (2) in C:\webapp\folder\index.php on line 24
The solution to the above error is really simple. Simply re-create the folder C:\Users\YOURNAME\AppData\Local\Temp\php\session\. For some reason, you or your Windows Vista (e.g. during a disk cleanup) may deleted all the files and folder under C:\Users\YOURNAME\AppData\Local\Temp\ and this is the main reason PHP can't find the correct location to create its temporary file for new session.
How to Request Reconsideration for Inclusion in Google Search Results
When a site's traffic from Google search engine dropped significantly or new site with a new domain has no traffic at all from Google search engine, you can expect that your site is no longer appear in Google's search results.
WordPress Plugin – Default Trackbacks
Default Trackbacks is a wordpress plugin that sends trackback to a list of preset URLs. It is enhanced version of my old Default Trackback. The old Default Trackbacks plugin store a list of predefiend URLs in text file while the new one store the list of URLs in WordPress database.
How to Monetize Your Youtube Video
If you have an Youtube account, always upload videos to Youtube and receive quite a lot of feedback on your Youtube video. Then you can make some money from your video. What? Earn money by publishing video? Yes, you can!
If you already have an Google Adsense account, you can add Video Unit to your video. Video Units are embedded, customizable video players featuring content from categories, individual content providers, or automatic keyword-based targeting. To setup the video play, you will first need to link your Google Adsense account with Youtube account.
How to Add Advertisement Code to WordPress Theme’s Sidebar
This may sound very simple to most of the bloggers who already have a WordPress blog and running ads on their blog. One who of my friend who just new to WordPress and having difficulty in adding advertisement codes to WordPress Sidebar.
I Hate Spam Blogs
Recently I received ping back from a blog that I think it is a spam blog. Each time I publish a new post, the site copies my content and republish it on it own blog and send a ping back to my blog. I think it is a blog that uses WordPress and with some kind of autopilot plugin. I hate that. It stole my original content and republish on it's own website. Sigh what can I do?
There are a few but this is the most frequent one hxxp://www.realrumors.net. I think the website has copied more than 6000 orignal posts from other websites. Hmm.
Do you guys encounter any spam blogs?
C#: Unix Time to .Net DateTime and Vice Versa
For some reasons, some programmer might store time values as Unix timestamp in database instead of standard SQL DateTime data type. The main reason to store time values as Unix timestamp is unknown but what I guess is for maximum database compatibility. Some old database does not support SQL DateTime data type.
Gmail: Inserting Images
Gmail provides no way to embed images, Youtube videos, sophisticated table layouts, Flash animation movies, inline podcast players like odeo, and etc. There is a copy and paste tricks that allow you to embed images into your rich text email in Gmail. You are actually copying a rendered HTML from either an existing web page or WYSIWYG HTML editor.
How Do You Know When Your Site Get Indexed in Google Search Engine?
How do you know when your site get indexed in Google search engine. You can actually use Google search engine to find out how your site is indexed. For example:
- to know the indexed pages in www.snipetit.com, simply query site:www.snippetit.com at Google search engine.
- to know the pages that link to your www.snipetit.com's front page, simply query link:www.snippetit.com at Google search engine.
- to know the current cache of www.snipetit.com's front page, simply query link:www.snippetit.com at Google search engine.
- to know the information of www.snipetit.com's front page, simply query info:www.snippetit.com at Google search engine.
- to know the pages that are similar to www.snippetit.com, simply query related:www.snippetit.com at Google search engine.


