Re: Cut text from a string
| From: | \"Crash\" Dummy | Date: | Thu, 02 Aug 2007 21:28:09 +0000 |
| Subject: | Re: Cut text from a string | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-260098@lists.php.net to get a copy of this message | ||
> I meant i want to get rid of the braces. e.g. get the text up to the start
> of the first brace and ignore anything from the first brace onwards
I don't see any braces, either. For the record:
brace = {}
bracket = []
parentheses = ()
comma = ,
semicolon = ;
To extract the partial string leading to the first parentheses:
$var="this is how we do (50 cents feat. the game)";
$stringpart = substr($var,0,strpos($var,"("));
--
Crash
Please reply to the group. E-mail is blocked.