Using explode in php to find whether a character exists
Source: Internet
Author: User
To facilitate input and reduce the number of text boxes that appear when the decoration and editing module is used, you need to enter two or three different content in one box, and then use some special characters to separate them, use explode to create a set of data. This method can also be used to determine whether the separator is available. For example:
Copy codeThe code is as follows:
If ($ _ MODULE [tg1_tjly]) {
$ Tg1_tjly = explode ("|", $ _ MODULE [tg1_tjly]);
If (count ($ tg1_tjly)> 1) {// here, when the statistical array is greater than 1, it indicates that it contains one or more interval symbols "| ".
$ Tg1_tjly_tit = $ tg1_tjly [0];
$ Tg1_tjly_con = $ tg1_tjly [1];
} Else {
$ Tg1_tjly_tit = 'reason for recommendation ';
$ Tg1_tjly_con =$ _ MODULE [tg1_tjly];
}
} Else {
$ Tg1_tjly_tit = 'Enter the Recommendation reason title ';
$ Tg1_tjly_con = 'Enter the content of the Recommendation reason. enter the content of the Recommendation reason. enter the content of the Recommendation reason. ';
}
?>
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service