У меня есть часть данных XML следующим образом:Как подсчитать количество повторений значения массива в другом элементе массива с помощью PHP?
<scientist>
<name>Emmy Noether&Amalie</name>
</scientist>
<day>
<date>03-23-2015</date>
<wiki>Emmy Noether&Amalie was an influential German mathematician known for her groundbreaking contributions to abstract algebra and theoretical physics. Emmy Noether&Amalie was born on 23 March 1882, the first of four children. In 1932 Emmy Noether and Emil Artin received the Ackermann–Teubner Memorial Award for their contributions to mathematics.</wiki>
</day>
Мой вопрос состоит в том, чтобы подсчитать количество раз значение scientist
name
(т.е. Emmy Noether&Amalie
) повторяется в wiki
элемента указанного выше элемента XML? Спасибо за вашу помощь.
да точно, что-то вроде 'файла =«file.xml»; $ xml = file_get_contents ($ file); $ xml = новый SimpleXMLElement ($ xml); $ array = json_decode (json_encode ($ xml), TRUE); ' – Sami
Я получил его, спасибо – Sami