//利用 explode 函數(shù)分割字符串到數(shù)組 復(fù)制代碼 代碼如下: <?php $source = "hello1,hello2,hello3,hello4,hello5";//按逗號分離字符串 $hello = explode(',',$source);

for($index=0;$index<count($ " /> 成人国产精品久久久,欧美日本久久,午夜a v电影

中文字幕日韩一区二区_国产一区二区av_国产毛片av_久久久久国产一区_色婷婷电影_国产一区二区精品

php中利用explode函數(shù)分割字符串到數(shù)組

分割字符串

//利用 explode 函數(shù)分割字符串到數(shù)組
復(fù)制代碼 代碼如下:
<?php
$source = "hello1,hello2,hello3,hello4,hello5";//按逗號分離字符串
$hello = explode(',',$source);

for($index=0;$index<count($hello);$index++)
{
echo $hello[$index];echo "</br>";
}
?>

//split函數(shù)進(jìn)行字符分割
// 分隔符可以是斜線,點,或橫線
復(fù)制代碼 代碼如下:
<?php
$date = "04/30/1973";
list($month, $day, $year) = split ('[/.-]', $date);
echo "Month: $month; Day: $day; Year: $year<br />/n";
?>


通過數(shù)組實現(xiàn)多條件查詢的代碼

復(fù)制代碼 代碼如下:
<?php
$keyword="ASP php,jsp";
$keyword=str_replace("  "," ",$keyword);
$keyword=str_replace(" ",",",$keyword);
$keyarr=explode(',',$keyword);
for($index=0;$index<count($keyarr);$index++)
{
$whereSql .= " And (arc.title like '%$keyarr[$index]%' Or arc.keywords like '%$keyarr[$index]%') ";
}
echo $whereSql;

php技術(shù)php中利用explode函數(shù)分割字符串到數(shù)組,轉(zhuǎn)載需保留來源!

鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請第一時間聯(lián)系我們修改或刪除,多謝。

主站蜘蛛池模板: 三级av网址| 99热这里都是精品 | 一级毛片在线看 | 亚洲一区二区三区久久久 | 一级大片网站 | 日韩免| 精品视频99| 91视频在线看 | 国产亚洲一区二区三区 | 午夜精品一区二区三区在线观看 | 久久亚洲一区 | 武道仙尊动漫在线观看 | 亚洲人成人一区二区在线观看 | 色综合色综合色综合 | 久久久久久久香蕉 | 久久成人综合 | 狠狠干天天干 | 欧美天堂 | 一区二区在线免费观看 | 欧美性吧 | 国产精品久久久久久52avav | 亚洲精品乱码久久久久久蜜桃91 | 激情五月综合 | 欧美在线网站 | 日韩中文字幕视频 | 欧美一级大片 | 狠狠躁天天躁夜夜躁婷婷老牛影视 | 黄网站在线播放 | 亚洲国产日韩一区 | 三级av在线 | 久久色视频| 久久精品国产99国产精品 | 国产精品不卡 | 国产一区二区在线免费播放 | 免费在线观看一区二区三区 | 国产精品久久久久久婷婷天堂 | 国产女人与拘做视频免费 | 一区二区久久 | 在线观看视频福利 | 日韩中出| 91性高湖久久久久久久久_久久99 |