1){ //The key point is Here, when the statistics array is greater than 1, it means that it contains one or more interval symbols "|". $tg1_tjly_tit = $tg1_t"/> 1){ //The key point is Here, when the statistics array is greater than 1, it means that it contains one or more interval symbols "|". $tg1_tjly_tit = $tg1_t">

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

How to use explode to find whether a certain character exists in exploded php

WBOY
WBOYOriginal
2016-07-29 08:46:04954browse

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 that it contains one or more interval 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. ';
}
?>

The above introduces the method of using explode to find whether a certain character exists in exploded php, including the content of exploded. I hope it will be helpful to friends who are interested in PHP tutorials.

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