remove special characters from string except @ in php code example
Example 1: php remove last character from string
$hell = substr('hello', 0, -1);
Example 2: determine special characters in php
<?php
$string = 'foo';
if (preg_match('/[\'^£$%&*()}{@#~?><>,|=_+¬-]/', $string))
{
// one or more of the 'special characters' found in $string
}