Home > Backend Development > PHP Tutorial > Instructions for using php implode() function_PHP tutorial

Instructions for using php implode() function_PHP tutorial

WBOY
Release: 2016-07-20 10:59:05
Original
1114 people have browsed it

Implode() was used yesterday to convert an array into a string. It is mainly used here, but the string it converts will have certain rules. If there are delimiters in the middle, I will introduce the implode() function below. usage. ​

Official method introduction

implode(separator,array)

implode() function returns the content array of a string. implode — Join array elements with a string

The code is as follows Copy code
 代码如下 复制代码


$arr = array('您好','百度!','美丽','一日!');echo implode(" ",$arr);
?>

$arr = array('Hello','Baidu!','Beautiful','One day!');echo implode(" ",$arr);

?>

Output.


Hello Baidu! Beautiful day!


In this way, I can see how to use implode. It is actually that simple.

http://www.bkjia.com/PHPjc/445623.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/445623.htmlTechArticle
implode() yesterday was to convert the array into a string. It is mainly used here, but it converts The string that comes over will have certain rules. If there is a delimiter in the middle, the following...
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template