0

Anyone knows how to display random words up to a random word in php?

2nd Mar 2018, 1:32 PM
Ledia
Ledia - avatar
3 Réponses
+ 4
No, if you copy/paste this codes, it does the work. The line which Split in an array is the following line ("//..." indicate that it is a comment) : $tabword = explode ( ' ', $words).
2nd Mar 2018, 3:16 PM
Geo
Geo - avatar
+ 3
<?php $words = "this is the life"; // Split in an array $tabword = explode(' ',$words); // Mix it shuffle($tabword); // Display foreach ($tabword as $word){ print ($word." "); } ?>
2nd Mar 2018, 2:35 PM
Geo
Geo - avatar
0
thank you, but can you please explain if I have to add anything else where you say to split it in an array, because I'm a beginner still?
2nd Mar 2018, 2:47 PM
Ledia
Ledia - avatar