Please help me with this:String function 2



$str= strpos("jahnavi","e");
print $str;



what is wrong with this code?


The Instruction asks you

01. On line 6, 
      use strpos() passing in your name as the haystack
      and a  letter from your name as the needle.

It does not seem to me that the letter "e" is part of your name !!!!!


I have done it exactly as it said but it says "Oops, try again. Your first strpos() call should output a number."

// Print out the position of a letter that is in
// your own name
strpos("kaushik", "a");

// Check for a false value of a letter that is not
// in your own name and print out an error message
if(strpos("novice","a")==false) {
print" the letter is not a part of the word";


Try it by using

echo strpos("kaushik", "a");

Have a read through