Jump to content


Photo

arrays


  • Faça o login para participar
1 reply to this topic

#1 davidcave

davidcave

    Normal

  • Usuários
  • 101 posts
  • Sexo:Masculino
  • Localidade:David

Posted 26/08/2017, 06:27

Hello,

 

i have an array with many values and the values are in twos separated by a comma, like this D3S1358=>15,16. i need to separate the two so that they are separate values each with its own variable like this $a will be 15 and $b will be 16. make sense?

 

Please help...

 

I didn't find the right solution from the Internet.
References


#2 Goku Jr

Goku Jr

    Nilson

  • Usuários
  • 3757 posts
  • Sexo:Masculino

Posted 26/08/2017, 10:18

 

Hello,

 

i have an array with many values and the values are in twos separated by a comma, like this D3S1358=>15,16. i need to separate the two so that they are separate values each with its own variable like this $a will be 15 and $b will be 16. make sense?

 

Please help...

 

I didn't find the right solution from the Internet.
References

 

Hi,

 

Use function explode() and list() 

 

Ex:

<?php
$array = array('15','16');
list ($a, $b) = explode(',', $array);
?>

-----------------------------------------------------------------------
PALMEIRAS - Primeiro campeão do mundo em 1951




1 user(s) are reading this topic

0 membro(s), 1 visitante(s) e 0 membros anônimo(s)

IPB Skin By Virteq