Not know Where i did mistake in Function PHP


#1

What to do?
How to solve this problem???


#2

Instructions:
2.Create a new variable $name and store your name in it.

you created $name="rahul"

3.Then print a random character from your name.
so you dont have to print

echo substr($name) or echo $change  //dont need

what you have to do just print random character(just one alphabet)
.
it can be r/a/h/u/l from your name


#3

Thanks for answer
but would you like to expand my question solution??
i did not understand what you wanna say...


#4

substr

string substr ( string $string , int $start [, int $length ] )

     $name="rahul";
     $select=rand(0,strlen($name)-1);  //random number 
  // echo $select.'<br />'; // don't need
     print substr($name,$select,1); // random character

check it
http://php.net/manual/en/function.substr.php

if you have any further questions please don't hesitate :slight_smile:


#5

Thanks man cheers!
Would you like to help me one more?
Please increase the speed of submit option Gear will take long time to run out or some time i have to refresh browser.
I am using google chrome and its updated and i hope your website supports this browser

Your website is awesome i have learnt many thing from here.
Thanks


#6

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.