Please help me with this:String function 2


#1



<?php

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

?>
</p>
<p>
<?php


if(strpos("Abhi","l")===false){
    echo"hii";
}
?>
</p>

what is wrong with this code?


#2

@abhijeetdesai,
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 !!!!!


#3

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



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



<?php
// 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";
}
?>



#4

@bytecoder41715,
Try it by using

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

Have a read through
http://stackoverflow.com/questions/1647322/whats-the-difference-between-echo-print-and-print-r-in-php