- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
strtok() function in PHP
The strtok() function is a tokenize string. It returns a string token.
Syntax
strtok(str, split)
Parameters
str − The string to split
split − Specifies one or more split characters
Return
The strtok() function returns a string token.
Example
The following is an example −
<?php $str = "This is it!"; $token = strtok($str, " "); while ($token !== false){ echo "$token<br>"; $token = strtok(" "); } ?>
Output
The following is the output −
This<br>is<br>it!<br>
Advertisements