New URL Shortener

I recently started a new URL shortener service. If you’re bored with old short-url services, you can start using this http://zip.ms Here you can set your-own custom alias, than some random string. I used Phurl library to create this website. I have no spam guard added in the site, please be a real human, I [...]

3 Comments , , ,

getId3 – PHP library for audio contents

I recently use getId3 library to manipulate audio files from PHP. It is very accurate than FFMPEG. For example, FFMPEG is not helpful for audio files having VBR (Various Bit Rate). It returns error max_analyze_duration reached OR “Estimating duration from bitrate, this may be inaccurate” But by using getId3, we can retrieve detailed information about [...]

0 Comments , , , , , , , ,

Use OOP in PrOPer way

Recently I read an article from IBM regarding the usage of Object Oriented Programming in PHP in a proper way. For an average PHP developer, I recommend it is good to read: Read Article Here I also went this link to understand more about abstract class and interface class Share

2 Comments , , , , ,

Explore a PHP class object

If you develop website using some framework (Symfony, Codeigniter or Zend etc), you need to play with several system defined objects like routing objects, session objects etc. To see what are the functions available inside an object on run time without referring the parent class documentation, here is a trick: print_r( get_class_methods(get_class($YourObject))); Now you can [...]

0 Comments , , , , , ,

Symfony 1.4 + Codeigniter = Symfony 2

Recently I tried Symfony 2 Sandbox for one of my projects. I realised this fact that Symfony 2 is so powerful because they restructured the Symfony 1.4 architecture and made a system like Codeigniter Framework. I wrote a post some months back about Codeigniter vs Symfony here. I need to re-edit that post now, because, [...]

8 Comments , , , , , , , , ,

Facebook Graph API – The missing part

As you all know recent changes in privacy issues made Facebook to change their basic API and added some security concerns. From my best practise, most of the old applications are safe, but you will be in trouble when you create new application. By default you cannot access user’s photos, profile pictures , albums etc. [...]

4 Comments , , , , , , , , , , , , , , , , , , , ,

Facebook Graph API for PHP

Like the old REST API, you don’t need to add 2-3 files for Facebook PHP SDK. The new graph api comes in a single file which is located at http://github.com/facebook/php-sdk/ Copy the facebook.php file in to your webroot and include this file in your php code. require_once(‘facebook.php’); To work fully functional, you need CURL and [...]

4 Comments , , , , , , , , , , , , , , ,

PHP Session problem with cloud server

There is a very strange issue with PHP session when you prefer session to save in files other than database (normal session). The problem is: some times you can access all the saved session values from $_SESSION and sometimes it returns a empty array. If you refresh 10 times, perhaps 4 times you will get [...]

3 Comments , , , , , , , , , , , ,

VARDUMP.IT – PHP remote debugging console

In PHP coding, we spend most of the time for debugging. Either we use echo, print_r or var_dump to check variable values or check whether a particular function is executing or not. These all things are outputting something to browser. This is not applicable in case of redirection, or image processing (GD) or sometimes with [...]

1 Comments , , , , ,

Multi-language support with PHP

If you aim to create a multi-language  website using PHP + Mysql , remember the following tips. You can use mysql database for this purpose rather than using separate language files as usual content management system does. You can create a table with following structure for this purpose.Table: muli-lang string_id: page_id: en: arb: fr: Here [...]

8 Comments , , , , , , , , ,

Algorithm for range of dates

Here is a php function which returns from and to date as an array for a range: <?php function get_rangeof_dates($time_frame = ‘all_time’) { $from_date = ”; $to_date = ”; switch($time_frame) { case ‘all_time’:        $from_date = ’1170-01-01 00:00:00′; $to_date = ’2250-12-31 23:59:59′; break; case ‘today’: $from_date = date(‘Y-m-d 00:00:00′); $to_date = date(‘Y-m-d 23:59:59′); [...]

0 Comments , , , , , , , , , , , , , , , , , ,

Facebook application development – Quick note

This is a quick note for myself to remember some tricks while we develop a Facebook application. If you are a beginner in Facebook application development, go here first. If  you an expert in Facebook development, go here. The steps in creating a facebook app. 1) Register an application in facebook 2) Add Canvas URL [...]

1 Comments , , , , , , , ,

PHP Spider – Sphider

We can create a search page for a dynamic website using Database queries and looping over resultant record sets. But what can we do if the website main contains static html files than dynamically populated content. In this case , we usually put Google search box inside website (Google custom search) Sphider is a php [...]

1 Comments , , , , , , , , , , , , ,

Firephp

We like firebug , We like PHP , if so, We also begin to  like FirePHP !!! Using firephp , you can debug your php code. Firephp is a firefox plugin which works on firebug console. In our php life, we know we can use echo function to print or debug the value of a [...]

2 Comments , , , , , , , ,

Mysql Table Editor

In a php project, if we get the requirement , we usually start design and database. But the data entry procedure is very hard. In this case PhpMyadmin is a good comfort.  Here is another tool from phpguru.org , MySQL Table Editor. Using this library you can make your database table editable from your php [...]

3 Comments , , , , , , ,