Please help me with this


#1

i dont know what or where i went wrong

https://www.codecademy.com/courses/web-beginner-en-7I7Xm/0/3?curriculum_id=5124ef4c78d510dd89003eb8#

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("emily", "e"); // 0

strpos("emily", "i"); // 2
strpos("emily", "ily"); // 2
strpos("emily", "zxc"); // false

<?php
// Check for a false value of a letter that is not
// in your own name and print out an error message

?>

Oops, try again. Your first strpos() call should output a number.


#2

Your strpos() is not inside the php brackets. Try:
<?php
strpos("emily", "e"); // 0
strpos("emily", "i"); // 2
strpos("emily", "ily"); // 2
strpos("emily", "zxc"); // false
?>

for the first section. Tell me if you need help with the second step in the lesson instructions


#3

im getting the same error code


#4

It wanted you to print the first strpos
Top part:

<?php
print strpos("emily", "i");
?>


#5

it the same error message


#6

It shouldn't:
Here is the full working code:

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

?>
</p>
</html>

#7

It makes you do the second part as well


#8

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