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

Functions, Part I Forum

View Course

251 points
3463c52a7911d68dea748d65d774c4c6?s=140&d=retro
Submitted by
Joe Curran
almost 2 years ago

String Functions II, 3/8, continuous error "first strpos should output a number...."?

Hi, I have written out the code exactly as it says in the example, yet it keeps coming up with this error....I write the strpos function, then brackets with my name and a letter from my name with all the correct punctuation, but nothing shows in the window and this error occurs. Its driving me mad!, any help would be greatly appreciated =]

Joe


1 vote

permalink

You need to store it as a variable and then print it on the next line.

$var = strpos("tn5421", "2");
print $var;

338 points
Picture
Submitted by
Tyler Nelson
almost 2 years ago

1 Comment

3463c52a7911d68dea748d65d774c4c6?s=140&d=retro Joe Curran almost 2 years ago

ah, so simple. thanks =]