The join () function combines array elements into a string. the join () function is the alias of the implode () function, for example, the following code :? The php $ arrarray (n... join () function combines array elements into a string. the join () function is the alias of the implode () function, for example, the following code:
The following is a condition on the dedecms search page that uses the join function:
starttime > 0) { $ksqls[] = " arc.senddate>'" . $this->starttime . "' ";}if ($this->typeid > 0) { $ksqls[] = " typeid in (" . getsonids($this->typeid) . ") ";}if ($this->channeltype > 0) { $ksqls[] = " arc.channel='" . $this->channeltype . "'";}if ($this->mid > 0) { $ksqls[] = " arc.mid = '" . $this->mid . "'";}$ksqls[] = " arc.arcrank > -1 ";$this->addsql = ($ksql == '' ? join(' and ', $ksqls) : join(' and ', $ksqls) . " and ($ksql)");?>
Here it forms a where condition for the select * from table and constructs a complete SQL query statement based on the number of $ ksql statements.
Note:Join () can receive two parameter sequences, but explode () cannot be used due to historical reasons. you must ensure that the separator parameter is prior to the string parameter.
In the database tutorial, tables can be connected by keys. the primary key is a column, and the values of each row in this column are unique. in the table, the values of each primary key are unique. the purpose of this operation is to combine the data in different tables without repeating all the data in each table.
Link to this article:
Add to favorites ^ please keep the tutorial address.