Showing posts with label php. Show all posts
Showing posts with label php. Show all posts

Thursday, November 18, 2010

menghilangkan "The Devil" eval()

Setelah lama ngoprek untuk menghilangkan ketergantungan the devil eval(), akhirnya nemu juga :)

here the script :

$toRun = "namaKelas";
$instance = new $toRun(); 

penggunaannya :
$instance->{"namaFungsi"}('parameter');

atau bisa juga
call_user_func_array(array(&$instance, "namaFungsi"), array("parameter"));