Archive: Posts Tagged ‘strings’

How To Strip All Non-Alphabetic Characters From A String?

String manipulation is the common thing to do with web application development. It is very easy to get it done when you are having a complete library to deal with it. PHP has a very vast support on string manipulation and has many functions including regular expressions support.

Sometimes you may need to work with user inputs to get only the alphabets. I searched a lot on google but didn’t find a suitable example to get it done. So I spent time, re-searched on net and created an example for myself and to share with you all. Hope it saves time for you in your development.

Continue reading…

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

PHP Functions: How to find strings between start and end from a string?

get_string_between
Today, I was working with some code related to CSV files and converting them to xml files (will talk about xml parsing and conversion later in other posts). I needed a function through which I could get a string from a string by giving a start needle and an end needle.

For example: Given a string variable like: $string = “I am a [string variable]“; and you want to fetch out everything which lies between “[" and "]“. You can use these functions given below to accomplish this task. So you will get the result as “string variable”.

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 change string’s case with PHP functions and with CSS

For a PHP developer, working with databases, arrays, doing string manipulations, etc are common daily tasks. While working with strings, you may sometime require changing case of the sting from lower to upper and vice versa or even you may need to change each word’s case in the given string. You can achieve all these by using following 5 PHP built in functions or you can use CSS property text-transform. Lets start with PHP functions.

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