Skrypt polega na losowaniu znaku z ciągu nazwy.
Tu jest fragment kodu
<?php // Use rand() to print a random number to the screen ?> </p> <p> <?php $name = "Johnny"; // Use your knowledge of strlen(), substr(), and rand() to // //?? // print a random character from your name to the screen. ?>
Zadanie to pochodzi z platformy e-learningowej codecademy.com
Sugerują mi użyć do tego substr, strlen. Próbowałem kilka sposobów, lecz wywala mi cały czas błąd.
Proszę o pomoc, i wyjaśnienie tego rozwiązania.
Pozdrawiam