Archive: Posts Tagged ‘PHP’

How to strip excess whitespace from a string with preg_replace()

PHP provides many pre-defined methods to deal with strings. One of the strong way to deal with strings is to use regular expressions aka ‘regex‘.

Let’s use regular expression with preg_replace() method to strip excess whitespace from a string.

Share or Bookmark this Post:
  • StumbleUpon
  • Digg
  • Twitter
  • del.icio.us
  • Facebook
  • Mixx
  • MySpace
  • Reddit
  • Google Bookmarks
  • Yahoo! Buzz
  • Technorati
  • Live
  • DZone
  • Netvibes
  • RSS
  • Print

How to create simple cool paging with PHP and CSS

It is quite common when you need of paging in your web application. A dynamic web is what consists of scripts and renders various pages depends upon the user requirements and where he/she wants to browse the web. Paging, categories, tags are all these type of browsing. We will talk about paging in this article and how to make it with simplest code in PHP. So let’s start:

paging screen shot
Paging screen shot: Live example is given below

Share or Bookmark this Post:
  • StumbleUpon
  • Digg
  • Twitter
  • del.icio.us
  • Facebook
  • Mixx
  • MySpace
  • Reddit
  • Google Bookmarks
  • Yahoo! Buzz
  • Technorati
  • Live
  • DZone
  • Netvibes
  • RSS
  • Print

How to add smilies in comments text and blog posts with simple PHP function?

Smileys are great way of expressing emotions with images/icons. You cant think of chatting with your friends without smileys. Am I right?

smileys 27 yearsIt’s been over 27 years when text smiley introduced also it’s been so long when smileys came out from IMs (Yahoo Messenger, Windows Messenger, etc) to comments on websites, blog posts. People use them to express the right amount of emotions and feelings they feel. You can see hundreds different smileys which helps people to show exact match of their expressions.

If you are using any of IMs available today, then I am sure you are aware of how you write a smiley in chat window. you just type the code like : ) and it converts into smiley like this :) Similarly, you use different smiley codes to show different smiley emotion icon. This article will help you to use the similar feature in your own web projects, commenting systems, blog posts, etc.

Share or Bookmark this Post:
  • StumbleUpon
  • Digg
  • Twitter
  • del.icio.us
  • Facebook
  • Mixx
  • MySpace
  • Reddit
  • Google Bookmarks
  • Yahoo! Buzz
  • Technorati
  • Live
  • DZone
  • Netvibes
  • RSS
  • Print
Real Time Web Analytics