Write a function in PHP that takes an array of strings as a parameter and returns a string representation of this array in XML; where keys in the array are the tag names and the value of each key is the text inside the tag.
The resulting XML must be valid.
The XML should be built as a string throughout the code. You are not allowed to use any other classes or functions (i.e. you are not allowed to use the SimpleXMLElement class)
You may add any extra elements as you see fit.
Assume the array keys already adhere to tag naming rules.
Hint: While testing (to see what the function actually returns), you may use the htmlspecialchars() function; or just check the returned document using Developer Tools on Chrome.
Bu iş için 3 freelancer ortalamada $4/saat teklif veriyor
I'll write that PHP function for converting associative arrays into XML with tag names derived from array keys today, get in touch to kick-start the implementation.