PHP 1 Flashcards

1
Q

$name =strlen(“sam”)

What does the function strlen do here?

A

Return length of the name.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

$myname =”samuel”;

$partial = substr($myname, 0, 3);

what does the function substr do?

A

print string from index 0 - 3.

sam will be printed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly