Strspn function instance tutorial _ PHP Tutorial

Source: Internet
Author: User
Strspns function example tutorial. Define and use the number of characters returned by the strspn () function. find the string that contains only characters from charlist. String: required. Definition and usage
The Strspns() The number of characters returned by the function indicates that the string contains only characters from charlist.

Syntax

Strspns (string, charlist, start, length)


Parameters

Description

String: required. String search

Charlist: required. Find the specified character

Start: Optional. Start with the specified string

Length: Optional. Note: This function is binary secure.

Example 1

Echo strspn ("Hello world! "," KHlleo ");


?>

Result: 5

Let's look at another example.Strspns tutorial.


Echo strspn ("abcdefand" abc ");


?>

Result 3


Returns the number of characters returned by the strspn () function. the string contains only characters from charlist. String: required. ...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.