Vedi se su PHP esiste la funzione EVAL.
Eventualmente studiati il funzionamento