Código PHP:
<?php
$var= "rand";
echo $var(0,10);//true print rand
?>
<?php
function connect($connect,$sentencia){
$connect=array(
mysqli_connect,
mysqli_select_db,
mysqli_query,
mysqli_fetch_assoc
);
$sentencia=array(
"'localhost','root',''",
"my_database",
"select * from table_connect",
);
$sentencia[]=$connect[3];
for($i=0;count($conect);$i++){
return $i;
if($connect[$i]($sentencia[$i]) === TRUE ){
return $connect[$i]($sentencia[$i]);
return "<br>Conection true";
}else{return "No connect Failed";}
}//for
}//fun
echo connect($connect,$sentencia);
?>