Question: What is the functionality of the function strstr and stristr?
Answer:
string strstr (string str1‚ string str2) this function search the string str1 for the first occurrence of the string str2 and returns the part of the string str1 from the first occurrence of the string str2. This function is case-sensitive and for case-insensitive search use stristr() function.
Example of strstr: $email = ’name@example.com’;
$domain = strstr($email‚ ’@’); echo $domain; // prints @example.com $user = strstr($email‚ ’@’‚ true); echo $user; // prints name ?>
Example of stristr: $email = ’USER@EXAMPLE.com’; echo stristr($email‚ ’e’); // outputs ER@EXAMPLE.com echo stristr($email‚ ’e’‚ true); // outputs US ?>
Secure file download in PHP, Security question PHP, PHP MYSQL Interview Question -Books download - PHP solutions guidelines queries update, phpmysqlquestion
Subscribe to:
Post Comments (Atom)
security header validate
HTTP Security Headers Check Tool - Security Headers Response (serpworx.com)
-
QUESTION: 1 What is the output of the following code? echo '1' . (print '2') + 3; A. 123 B. 213 C. 142 D. 214 E. ...
-
Windows tool for creating a self-signed certificate. https://sourceforge.net/projects/portecle/ kindly install portecle tool from abov...
-
Which pillar of the AWS Well-Architected Framework recommends maintaining infrastructure as code? Operational Excellence Which of the foll...
No comments:
Post a Comment