I wrote a parser and a script that later adds products to, but it works for a long time, and if there are more entries in the xml file, it does not have time to work to the end.
$languages = simplexml_load_file("test.xml", null, LIBXML_NOCDATA); $i = 0; foreach ($languages->groupProduct as $group) { if((string) $group['name'] == "01 Плитка") { foreach ($group->element_list->element as $element) { $data = array(); //массив данных $file_name = date('YmdHis').rand(100,1000); $data["img"] = $file_name.".jpeg"; foreach($element->minpart_list->minpart as $minpart) $data["description"] .= $minpart."<br />"; if ($this->add($data)) { $this->download_remote_file($element->pic, "../".$this->config->dir_img_products.$data["img"]); } $i++; } } } function download_remote_file($file_url, $save_to) { $content = file_get_contents($file_url); file_put_contents($save_to, $content); } How can I increase the performance of the script?

max_execution_timein the settings of pkhp - teran