The join () function combines array elements into a single string.
The join () function is an alias for the implode () function.
Example
$arr = Array (' Hello ', ' world! ', ' beautiful ', ' day! ');
echo Join ("", $arr);
?> output:
Hello world! Beautiful day!
The following is a DEDECMS search page condition takes advantage of the Join function
if ($this->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)");
It makes up a select * from table where condition, based on how much $ksql is constructed into a complete SQL query statement
Note: Join () can receive two parameter sequences. But for historical reasons, explode () is not working. You must ensure that the separator parameter is not preceded by a string parameter.
The tables in the database tutorial can be linked by keys. The primary key (primary key) is a column, and the value of each row in the column is unique. In the table, the value of each primary key is unique. The purpose of this is to cross-bind the data between tables without repeating all the data in each table.
http://www.bkjia.com/PHPjc/631346.html www.bkjia.com true http://www.bkjia.com/PHPjc/631346.html techarticle the Join () function combines array elements into a single string. The join () function is an alias for the implode () function. Example PHP Tutorial $arr = array (' Hello ', ' world! ', ' beautiful ', ' day! '); echo Join ...