This forum is now read-only. Please use our new forums at discuss.codecademy.com.

Functions, Part I Forum

View Course

47 points
3b26db250f2180fa7e529b11bbd7579d?s=140&d=retro
Submitted by
michaelmamah
over 1 year ago

Why does the strpos not work?

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


<?php
// Check for a false value of a letter that is not
// in your own name and print out an error message
if (strpos ("Michael","j") === false){
print "Sorry, no 'j' in 'Michael'";
}
?>

Hi above is my code.
The second part of the question works but the first part i.e. strpos does not
Please help


0 votes

permalink

you need to print strpos

758 points
2c0abd8c404a4dfc6fbda5ebf268e3e6?s=140&d=retro
Submitted by
doffylaw
over 1 year ago

3 Comments

3b26db250f2180fa7e529b11bbd7579d?s=140&d=retro michaelmamah over 1 year ago

Thanks a lot doffylaw :)

518d4c48b047b9d2760017bb_484778082 Lmar over 1 year ago

How did you get it to work? I'm having the same problem

2c0abd8c404a4dfc6fbda5ebf268e3e6?s=140&d=retro doffylaw over 1 year ago

print strpos("name", "a");