inner join php code example

Example 1: php inner join array

$array1 = [1, 5, 64, 2, 6];
$array2 = [2, 1, 8, 3];

//Method 1:
array_filter($array1, function($_){
    global $array2;
  return in_array($_, $array2);
}); // Output: [0 => 1, 3 => 2]

//Method 2:
array_intersect($array1, $array2); //Output: [0 => 1, 3 => 2]

Example 2: inner join in php

<?php
SELECT t1.*, t2.subject, t2.color FROM questionoftheday t1 INNER JOIN subject t2 
ON t1.sid = t2.ID WHERE t1.qdate='$newrd' AND t1.status='1' ORDER BY t1.ID DESC
?>

Example 3: inner join in php opp

echo "pakistan";

Tags: