This forum is now read-only. Please use our new forums! Go to forums

0 points
Submitted by CHIEN-MING
over 8 years

i have problem in PHP, Functions 5/8

i can’t run~ it still shows “The random output you printed from your name should be just one character.” could u solve the problem? thank you!

this is my code:

Answer 5613aea73e0ec879db0001be

1 vote

Permalink

points
Submitted by doffylaw
over 8 years

1 comments

CHIEN-MING over 8 years

thank you

Answer 5614aced95e378a33300002c

0 votes

Permalink

print rand (1,10); should choose a range

$name = ‘chien-ming’; print substr ($name, rand(0,strlen($name)-1 , 1) ; strlen($name) should substract 1 since string starts from 0,1 …. strlen($name) - 1.

points
Submitted by Li Fang
over 8 years