i have a reccuring function that i want to call it again with the correct syntax how to do it?i have in database if its a country it holds V: and it has the format Col1 CountryName; col1 if its a city it doesnt have V: if its a region in country it has V: so this recursion has to be until we get the cities that are in one country in the database Country= V:area1, V:area2…Area1=City1 or Another V:area ant that so until we get to city names..here what ive done so far and i am closo but i don’t know how to call again the same function
function recur($d,$rek,&$aeroPole1)
{
if(substr_count( $d, 'V:'))
{
$aeroPole=preg_replace('"V:"','',$d);
$aeroPole=explode(",",$aeroPole);
foreach($aeroPole as $ap)
{
$mysqliObj3 = new mysqli('localhost','usr','pass', 'trevo');
$comand6="SELECT * FROM `CC` WHERE name='".$ap."';"; // name='".$RuleD[0]."';";
$QueryObj6 = $mysqliObj3->query($comand6, MYSQLI_USE_RESULT);
$dArea=$QueryObj6->fetch_assoc();
$QueryObj6->close();
if($dArea!="")
{$rek+=1;
$aeroPole1=array_merge($aeroPole1,recur((string)$dArea["airport_codes"],$rek,$aeroPole1));
$fore++;
}
}//foreach
}
}
edit: closed a bracket
the other case if it hasn’t v: