search
HomeBackend DevelopmentPHP ProblemWhat does explode mean in php?

What does explode mean in php?

Sep 05, 2019 pm 01:09 PM
php

What does explode mean in php?

##PHP explode() function

Definition and usage (recommended learning:

PHP video tutorial

explode() function breaks up the string into an array.

Note: The "separator" parameter cannot be an empty string.

Note: This function is binary safe.

Syntax

explode(separator,string,limit)<br/>

Parameter description

separator: required. Specifies where to split the string.

string: required. The string to split.

limit is optional. Specifies the number of array elements to be returned.


Possible values:

Greater than 0 - Returns an array containing at most limit elements

Less than 0 - Returns an array containing all but the last -An array of all elements except limit elements

0 - Returns an array containing one element

Return value: Returns an array of strings

Break the string into an array:

<!DOCTYPE html><br/><html><br/><body><br/><br/><?php<br/>$str = "Hello world. I love Shanghai!";<br/>print_r (explode(" ",$str));<br/>?>  <br/><br/></body><br/></html><br/>

The above is the detailed content of What does explode mean in php?. For more information, please follow other related articles on the PHP Chinese website!

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

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

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.