I'm iterating through an XML and get a specific node. This node will be saved into an array but there is a problem. The array values have a space like this:
array(4) { ["host"]=> string(55) " localhost " ["username"]=> string(50) " root " ["dbName"]=> string(56) " test " ["dbPass"]=> string(52) " 123456 " }
You can see each values have a space before and after the value. The final result that I want achieve is this:
array(4) { ["host"]=> string(55) "localhost" ["username"]=> string(50) "root" ["dbName"]=> string(56) "test" ["dbPass"]=> string(52) "123456" }
If I do trim($array_node)
I get an empty array.