eval - PHP Error Undefined Functions -


i getting error undefined function.

here code:

$myvar = "@file_get_contents";  eval($myvar("http://someurlupdatehere.com"));  error is:   <b>fatal error</b>:  call undefined function @file_get_contents() ..  

it looks weird me trying do. tend "don't use eval, don't that!" ;)

anyway, here comes right syntax:

$myvar = "@file_get_contents"; eval("$myvar('http://someurlupdatehere.com');"); 

or if need return value of file_get_contents() in variable (what likely, use this:

$myvar = "@file_get_contents"; eval("\$file = $myvar('http://someurlupdatehere.com');"); echo $file; 

Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -