Categories
-
Recent Posts
Archives
Blogroll
Category Archives: PHP
QR Code Generate Class in PHP
A QR code (short for Quick Response) is a specific matrix barcode (or two-dimensional code), readable by dedicated QR barcode readers and camera phones. The code consists of black modules arranged in a square pattern on a white background. The information encoded can be text, URL or other data. QR code is pretty efficient in spreading messages to smartphone devices. You can use your iphone, ipad, android phone or other smartphones to scan the code anywhere, then you would be …
Read More
Simple snippet to get file extension in php
Following is a simple snippet I use to get a file extension in php, notice that the strrpos function returns the last position of the string “.” in filename in case there are multiple dots in file name. <?php /** * Function that returns file extension by its name. * @param unknown_type $fileName * @return $ext */ function fileExt($fileName) { /* sttrpos to get last position of “.” */ $dot = strrpos($fileName, ‘.’); if($dot === FALSE) return FALSE; $ext = …
Read More