search
Homephp教程php手册字符处理函数 strtok(string str,string arg)

函数

今天用到一个函数,查了一下手册,给出了如下的说明:
<?php$string = "This is\tan example\nstring";$tok = strtok($string," \n\t");while ($tok) {    echo "Word=$tok<br>";    $tok = strtok(" \n\t");}?>
输出:
Word=This
Word=is
Word=an
Word=example
Word=string
这个函数还有自动存储位置的功能,能够在连续的切割字符串取得相应的值,相对于split(string arg)的值
保存在数组中,但其arg却可以是多个字符,而split只能一个字符!
 



Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool