In this article, we will explain to you how to convert XML into associative array in PHP. sometimes we need to convert XML file into an associative array in PHP. so here we use the file_get_contents() function to read an XML file into PHP. so you can see our following example.
In this step, we will create the XML data file and save the XML file as user.xml. so you can see the following XML code.
User Details 4 john doe john123 ajay devgan ajdev rohit sharma rs123 kapil sharma ks123