3
Guys I get data from my database that comes this way 1,2,3,4,5 And I need to run each number, because each number is a user ID and I want it to show each one separately without comma or anything,?
3
Guys I get data from my database that comes this way 1,2,3,4,5 And I need to run each number, because each number is a user ID and I want it to show each one separately without comma or anything,?
5
Thus:
<?php     
    $numeros = '1,2,3,4,5';
    $num = explode(',', $numeros);
    foreach($num as $n){
       echo $n;
       echo PHP_EOL;
    }
Example: Ideone
Browser other questions tagged php mysql string
You are not signed in. Login or sign up in order to post.
The answer worked out for you Vinicius?
– user6026
Yes! I managed to perform my task, sorry I didn’t update the question yet..
– Vinicius Eduardo