-1
How can I set a key for an array with multiple values?
The array lists all trackers (in which case there is no key defined);
$trackers = array(
'udp://9.rarbg.to:2970',
'udp://tracker.coppersurfer.tk:6969/announce',
'udp://tracker.leechers-paradise.org:6969'
);
Resultado:
Array
(
[0] => udp://9.rarbg.to:2970
[1] => udp://tracker.coppersurfer.tk:6969/announce
[2] => udp://tracker.leechers-paradise.org:6969
)
Resultado desejado:
Array
(
[0] => Array
(
[protocolo] => udp://9.rarbg.to:2970
)
[1] => Array
(
[protocolo] => udp://tracker.coppersurfer.tk:6969/announce
)
[2] => Array
(
[protocolo] => udp://tracker.leechers-paradise.org:6969
)
)
Obs.: before opening the question I already reviewed the internet and I found nothing that helps me.
Something so simple and I looking for a sophisticated method to do this, thank you.
– Vitor Hugo