Answer the question
In order to leave comments, you need to log in
How to form a list of XML elements with the same attributes based on a php array?
There is a numeric array of telephone numbers, it must be converted to an associative array,
so that all elements of the array have the same keys! How can I do that?
// в таком виде массив приходит на PHP скрипт в результате Ajax запроса
$NrList = array(
0=>'9250999998',
1=>'9250999911'
);
<NrList>
<Nr>9200925068</Nr>
<Nr>9200925069</Nr>
</NrList>
Answer the question
In order to leave comments, you need to log in
in any way, in an array keys can only be unique.
$NrList = array(
'Nr'=>'9250999998',
'Nr'=>'9250999911'
);
This isarray(1) {
'Nr' =>
string(10) "9250999911"
}
key cannot be the same
$NrList = array(
'Nr'=>array('9250999998',
'9250999911')
);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question