(PHP 4, PHP 5, PHP 7, PHP 8) trim—Strip whitespace (or other characters) from the beginning and end of a string Description trim( string$string, string$characters= \n\r\t\v\x00 ):...www.php.net
To add to what others have said, you can't directly put a $_GET or $_POST value into a variable then into an attribute using SimpleXML. You must first convert it to an integer...www.php.net