Home  >  Article  >  Backend Development  >  How to use explode to find whether a certain character exists in PHP_PHP Tutorial

How to use explode to find whether a certain character exists in PHP_PHP Tutorial

WBOY
WBOYOriginal
2016-07-21 15:26:53880browse

This method can also be used to determine whether the delimiter exists. For example:

Copy code The code is as follows:

if($_MODULE[tg1_tjly]){
$tg1_tjly = explode("|",$_MODULE[tg1_tjly]);
if(count($tg1_tjly)>1){ //The key point here is that when the statistics array is greater than 1, it means it contains 1 or more separator symbols "|".
$tg1_tjly_tit = $tg1_tjly[0];
$tg1_tjly_con = $tg1_tjly[1];
}else{
$tg1_tjly_tit = 'Recommendation reason';
$tg1_tjly_con = $_MODULE[ tg1_tjly];
}
}else{
$tg1_tjly_tit = 'Enter the recommendation reason title';
$tg1_tjly_con = 'Enter the recommendation reason content, please enter the recommendation reason content, please enter the recommendation reason content. ';
}
?>

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/323844.htmlTechArticleThis method can also be used to determine whether there is the delimiter symbol. For example: Copy the code as follows: ?php if($_MODULE[tg1_tjly]){ $tg1_tjly = explode("|",$_MODULE[tg1_tjly]); if(coun...
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