tags:

views:

20

answers:

2

Hi friends,

I'm a newbie php guy.

I have 1 string output from Drupal's date module as below;

Dec 5 2010 (All day) - Dec 7 2010 (All day)

and I need to display only date, without (All day).

So, how can I display it as below? is there any php func that I can crop some parts of string?

Dec 5 2010 - Dec 7 2010

appreciate helps!! thanks a lot!

+1  A: 
$stripped = str_replace(' (All day)', '', 'Dec 5 2010 (All day) - Dec 7 2010 (All day)');
Tobias P.
+3  A: 
$in_string = 'Dec 5 2010 (All day) - Dec 7 2010 (All day)';
$out_string = str_replace('(All day) ', '', $in_string);
cypher
+1: I was just about to write this :)
Denis 'Alpheus' Čahuk
cool! thanks! working great
artmania