dealmaker
02-03-2006, 08:01 AM
Hi,
I got the following error, and I don't know why. I try to search characters "@#^&-_+=\:;/," at the end of a string. How do I fix it? Many thanks.
Parse error: parse error, unexpected '\"'
class myclass {
const pattern = "/[@#^&\-_+=\\:;/,]$/";
function func($data) {
if(preg_match(self::pattern, $data)) // parse error
echo 'match';
}
}
$var = myclass();
$var->func('12345');
I got the following error, and I don't know why. I try to search characters "@#^&-_+=\:;/," at the end of a string. How do I fix it? Many thanks.
Parse error: parse error, unexpected '\"'
class myclass {
const pattern = "/[@#^&\-_+=\\:;/,]$/";
function func($data) {
if(preg_match(self::pattern, $data)) // parse error
echo 'match';
}
}
$var = myclass();
$var->func('12345');