Problem using substr() and strpos() functions
| From: | rich | Date: | Fri, 14 Nov 2003 09:13:47 +0000 |
| Subject: | Problem using substr() and strpos() functions | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-169624@lists.php.net to get a copy of this message | ||
Hello List,
I'm trying to extract the sub-string from a string which appears between a
pair of brackets,
e.g. from "Mozart Requiem (15)"
I want to extract the string "15"
I tried this:
substr($s, (strpos($s, "(") + 1), (strpos($s, ")") - strpos($s, "(") -
1))
but it returned the error:
"Parse error: parse error, unexpected T_STRING in /.../loan-edit.php on line
15"
What have done wrong?
Thanks in advance,
Richard
--
UEA/MUS