In PHP, the implode () function combines array elements into a string, and the explode function is exactly what it is, and here are some examples of implode functions.
Grammar
Implode (Separator,array)//array, separator is a separator.
Example
Link
Instance
Combine array elements into a single string:
Definition and usage
The implode () function returns a string that is composed of array elements.
Note: the implode () function accepts two parameter orders. However, for historical reasons,
Use of implode, explode, implodeexplode. The use of implode and explode. the implodeexplodeimplode function converts an array into a string, which is especially useful when combining SQL statements! For example, $ aarray (a, B, c); $ bimplode (, $ a
Grammar
Implode (Separator,array)//array is an array, separator is a cut character.
Example
The code is as follows
Copy Code
Link search criteria$wheresql = Implode (' and ', $wherearr); Link search criteriafunction
The use of Implode,explode, Implodeexplode
Implode the function of turning an array into a string, use it in combination with SQL statements!
Like what
$a = Array (' A ', ' B ', ' C ');$b = Implode (', ', $a);Echo $b;
The returned string is
Use of implode and explode. The implode function converts an array into a string, which is used to combine SQL statements! For example, $ aarray (a, B, c); $ bimplode (, $ a); echo $ B; the returned string is the, B, c implode function that converts
The explode () function in PHP is to split another string with one string and return an array of strings. The implode () function returns a string that is composed of array elements. The two functions are between the strings and the array
function
CheckBox submitted by an array, in order to insert the values in the array into the SQL statement execution, you need to separate the array's key values with commas:Index.html1232.php$array = $_post["select"];$select = Implode (",", $array);Echo
Mysql connection operation class on the phpmysql website/* obtain the time of the last updated table in the SQL statement. if there are multiple tables, return the time of the latest table */
Mysql connection operations on the php mysql website
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.