How can I make a explode
in a variable where I can then access it by nominal index , and not by numeric index ?
Follow the example to get clearer:
<?php
// Aqui acesso pelo índice
$user = "Diego:25:RJ";
$info = explode(":",$user);
echo "O nome é ".$info[0];
?>
Instead of using:
echo "O nome é ".$info[0];
I would like to use:
echo "O nome é ".$info["nome"];
In my actual example, I would solve a certain situation in which the insertion or removal of certain information could be poor in use with the use of numeric index.