Magento::calling a static block in your template file (.phtml)

To call a static block in Magento, Following single line will solve your problem,

<?php getLayout()->createBlock('cms/block')->setBlockId('my_static_block_name')->toHtml() ?>

Definitely we’ll write this line in some .phtml file for which you want to call this block …

Hope this tip will be helping for someone 😉


PHP :: remove special characters from a string

This could be just a quick and easy help for someone who is wishing to remove special characters from some string OR wishing to just keep alpha numeric characters in the string. So here is the Regular expression for that:

preg_replace('/[^a-z0-9]/i', '_', $string)

Most useful PHP Libraries

Did you faced such situation that you need to complete a project on early basis and you waste your big time to search for your required libraries and then knowing how to go for your integration? Yes .. such days often come in some software developer’s life ..

Open source matters! so PHP is at top for helping you by providing such a huge community where you get great “plug and play” stuff for attaining quicknees in your work.
In same respect, Today i am gonna share with you a list of 20 Most Useful PHP libraries about which every PHP developer must now. So here they are:

Charting Library

GD library may help you to create a good but simple chart but for complex charts, here are some great libraries:

  1. pChart – a PHP class to build charts.
  2. Libchart – Simple PHP chart drawing library.
  3. JpGraph – Object-oriented graph creating library for PHP.
  4. Open Flash Chart – Flash based charting library.

RSS Parser Library

Parsing a RSS gets painful sometime, so why don’t you prefer to use any of following libraries and enjoy???

  1. MagpieRSS – RSS for PHP.
  2. SimplePie – Super-fast, easy-to-use, RSS and Atom feed parsing in PHP.

Thumbnail Generator

Good way for generating Thumbnails.

  1. phpThumb – The PHP thumbnail creator.


Playing with an e-commerce site? Need payment solution?. Let this library help you 😉

  1. PHP Payment Library – PHP Payment Library for Paypal, and 2Checkout (2CO)


Just in case you need to implement OpenID to your project.

  1. PHP-OpenID – OpenID implementation in PHP.

Database Abstraction/ORM

 These library let you smile more while writting SQL quries.

  1. ADOdb – Database abstraction library for PHP.
  2. Doctrine – Object relational mapper (ORM) for PHP 5.2.3+ that sits on top of a powerful database abstraction layer (DBAL).
  3. Propel – Object-Relational Mapping framework for PHP5
  4. Outlet – an Open source object-to-relational mapping tool for PHP.

PDF Generator

  1. FPDF – PHP class which allows to generate PDF files with pure PHP.


Enjoy if you need to generate your report in Excel file while using these libraries .

  1. php-excel – Very simple library for generating excel documents from php on-the-fly.
  2. PHP Excel Reader – Parse and retrieve information from XLS files.


Don’t like PHP mail function? Give a chance to any of these libraries:

  1. Swift Mailer – Free Feature-rich PHP Mailer.
  2. PHPMailer – Powerful email transport class with a big features and small footprint.

Unit Testing

For Test-driven development lover, these library will help great.

  1. SimpleTest – PHP unit test and web test framework.
  2. PHPUnit – Member of the xUnit family of testing frameworks and provides both a framework that makes the writing of tests easy as well as the functionality to easily run the tests and analyse their results.

Hope these libraries will make your programming life more easier and happy 🙂

Happy Coding 😉

its been long time …

It’s been long time that i got chance to write some thing on my blog.

Sometimes, Life gets too busy and even you don’t find time for yourself but … We spend the time somehow ..

Hopefully you’ll see further informative and much logical stuff from my side (this wasn’t an announcement but a humble decision 🙂 ).

See ya 😉

css tip : set margin parameters

if you get confuse and feel hard to remember the parameter sequence for ‘margin’ tag in css then just bookmark the url of my this post 🙂

General Format:

margin:Toppx Rightpx Bottompx Leftpx



<div style=” margin:14px 10px 7px 16px;”>
This inline css code will make this div to produce margin: 14px at top, 10px at right, 7px at bottom and 16px at left

Hope this will help someone 😉