C# String Formating

August 2, 2008

String formating is pretty easy task in C# or ASP.NET

To format date you use:
{0:d}

To format numers to contains semicolon as thousand separator you use:
{0:n}

The easiet way to format a string is to use String.Format method.

How to strip html tags from text in PHP

August 2, 2008

Recently I faced small problem when working for one of my clients. He stores html tags in database:

<font color="00ff00">Some text</font>

 

I need quick and dirty solution, so I decided to use php function strip_tags()

This function removes all html text leaving only text, this was exactly what I need.

The final code look like this:

$text = strip_tags('Text‘);