PDA

View Full Version : 'eval' and with alot of trouble


gavimobile
08-16-2012, 11:01 PM
hey folks,

its been some time since my last post!

im using php 5.3.x and i know its not recommended to use the eval() function however i found a need where i must use it.

how can i use a foreach loop inside of the eval function.


eval("
foreach (\$var as \$key => \$value) {
...
}
");
i believe i need to escape the arrow but i dont know how

thanks in advance

gavimobile
08-19-2012, 11:54 AM
i solved this issue,
it was a silly mistake on my side! there wasnt any solution. just double checked my work :-p