自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

解讀PHP函數(shù)explode()的具體使用方法

開發(fā) 后端
PHP函數(shù)explode()的作用就是把字符串分割為數(shù)組,具體語法為:explode(separator,string,limit)。我們將會給大家?guī)砭唧w的代碼示例,方便理解。

目前PHP語言算是相當(dāng)火的一門高級語言。我們可以用它來創(chuàng)建一個(gè)高性能的網(wǎng)站等。今天我們?yōu)榇蠹規(guī)淼氖怯嘘P(guān)PHP函數(shù)explode()的具體用法,希望能對又需要的朋友有所幫助。

#t#PHP函數(shù)explode()把字符串分割為數(shù)組
explode(separator,string,limit)
separator 必需。規(guī)定在哪里分割字符串。
string 必需。要分割的字符串。
limit 可選。規(guī)定所返回的數(shù)組元素的最大數(shù)目。

PHP函數(shù)explode()例子
 

  1. <?php 
  2. $str = "Hello world. It's a beautiful day.";  
  3. print_r (explode(" ",$str));  
  4. ?> 

輸出:
 

  1. Array  
  2. (  
  3. [0] => Hello  
  4. [1] => world.  
  5. [2] => It's  
  6. [3] => a  
  7. [4] => beautiful  
  8. [5] => day.  

以上代碼示例就是PHP函數(shù)explode()的具體使用。

責(zé)任編輯:曹凱 來源: CSDN
相關(guān)推薦

2009-12-07 16:52:59

PHP函數(shù)getima

2009-11-26 15:23:24

PHP函數(shù)ereg()

2009-12-01 19:02:20

PHP取整函數(shù)

2009-12-02 18:51:12

PHP分頁類

2009-11-24 16:18:14

PHP5析構(gòu)函數(shù)

2009-11-30 15:00:19

PHP加密解密函數(shù)au

2009-11-25 10:02:27

PHP會話Sessio

2009-12-01 17:00:49

PHP變量

2009-11-24 19:25:32

PHP關(guān)聯(lián)數(shù)組

2009-11-24 15:50:09

PHP上傳類uploa

2009-11-30 17:43:54

PHP split()

2009-12-01 18:02:41

PHP表單數(shù)組

2009-11-16 16:54:00

PHP構(gòu)造函數(shù)

2009-11-30 18:08:30

PHP制作動態(tài)計(jì)數(shù)器

2009-11-26 18:49:54

PHP函數(shù)preg_s

2009-11-16 15:40:58

PHP數(shù)組函數(shù)

2011-07-12 17:18:23

PHPstrtotime

2009-12-03 17:18:15

PHP strtoti

2009-12-02 16:04:44

PHP fsockop

2009-11-26 19:18:59

PHP函數(shù)implod
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號