I have this code where I get the value of a post and ajax.
$string = 'nome=Alexandre+Sousa&cpf=0000000000000&email=sousa.akira%40gmail.com&site=www.uniaomaker.com.br';
$dados = explode('&',$string);
$total = count($dados);
$array = '';
foreach ($dados as $list) {
$vals = explode('=',$list);
$array .= '"'.$vals[0].'"'. '=>'.'"'.$vals[1].'"'.',';
}
$keys = array($array);
echo '<pre>';
print_r($keys);
The result I get is the following
Array ( [0] = > "name" => "Alexandre + Sousa", "cpf" = > "0000000000000", "email" => "sousa.akira% 40gmail.com", "site" => "www.uniaomaker.com .br ", )
But I need the array to return this way
Array ( [name] = > Alexandre + Sousa [cpf] = > 0000000000000 [email] = > sousa.akira% 40gmail.com [site] = > www.uniaomaker.com.br)
I've tried many more tips and I have not found a solution,