Hi,
How to use spaces in createElement while creating xml file
I have to use
$main = $doc->createElement("$cname"."Data" );
where
$cname="Company Name"
But due to spaces in $cname
, I am getting the following error,
Fatal error: Uncaught exception 'DOMException' with message 'Invalid Character Error' in file.php:50 Stack trace: #0 file.php(50): DOMDocument->createElement('geosoft company...') #1 {main} thrown in file.php on line 50
How to rectify this?
Regards, Rekha