Hi! Could we please enable some services and cookies to improve your experience and our website?
Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code
<?php
function custom_function(string $str1, string $str2) {
$arr1 = explode(',', $str1);
$arr2 = explode(',', $str2);
return array_combine(array_diff($arr1, $arr2), array_diff($arr2, $arr1));
}
$str1 = "no,yes";
$str2 = "no";
$diff = custom_function($str1, $str2);
var_dump($diff);