How to use spaces in createElement when creating xml file
I need to use
$main = $doc->createElement("$cname"."Data" );
Where
$cname="Company Name"
But due to spaces in $cname, I get the following error:
Fatal error: exception for exception "DOMException" with the message "Invalid character error" in the .php file: 50 Stack trace: # 0 file.php (50): Level above> createElement ('Geosoft company ...') # 1 {main } thrown in file.php on line 50
How to fix it?
Regards, Rekch
source
share