Home > Backend Development > PHP Tutorial > 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
Release: 2016-07-29 08:46:04
Original
1009 people have browsed it

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.

Related labels:
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