Solution:
Many PHP functions are modeled after C standard library functions, not just string functions. Examples include printf(), fopen(), and fnmatch().
strlen()
Directly mirrors the C strlen() function, with identical behavior.
strpos()
While not a direct C standard function, it is analogous to strstr() and strchr().
The naming follows the same pattern of string-related functions in C.
In C, returning a pointer to a substring is cheap, so the distinction between strstr() and strpos() isn’t a performance concern there.
strtoupper() / strtolower()
C doesn’t have these exact functions, but the concept is inspired by functions like strtol(), strtof(), and strtoull() that convert strings to numbers.
Additional Note:
The old PHP MySQL extension mirrored the MySQL C API closely, including function names like mysql_real_escape_string(). This shows a general trend in PHP of adopting naming and behavior patterns from C.