Reputation: 6064
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!
Upvotes: 2
Views: 221
Reputation: 6992
$in_string = 'Dec 5 2010 (All day) - Dec 7 2010 (All day)';
$out_string = str_replace('(All day) ', '', $in_string);
Upvotes: 3
Reputation: 4665
$stripped = str_replace(' (All day)', '', 'Dec 5 2010 (All day) - Dec 7 2010 (All day)');
Upvotes: 1