Hello,
If I had the following string: Good Movie (Widescreen)
and I wanted to delete the (Widescreen), so everything inbetween the parren and including the parren.
How would I do this??
Thank you!
Trim between characters
Moderator: General Moderators
Code: Select all
$str = 'Good Movie (Widescreen)';
$newstr = preg_replace("#\(.*?\)#",$str);
echo $newstr;Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Thanks! But I receive an error "Wrong parameter count"scottayy wrote:Code: Select all
$str = 'Good Movie (Widescreen)'; $newstr = preg_replace("#\(.*?\)#",$str); echo $newstr;
- dibyendrah
- Forum Contributor
- Posts: 491
- Joined: Wed Oct 19, 2005 5:14 am
- Location: Nepal
- Contact:
Missing one parameters :
Code: Select all
<?php
$str = 'Good Movie (Widescreen)';
$newstr = preg_replace("#\(.*?\)#", "", $str);
echo $newstr;
?>