Jump to content

Is this possible? Variables in an If statement. Please help


BreakBreak

Recommended Posts

This way:

 

<?php

$a = "2 >";
$b = 1;
$str = "if(".$a.$b."){echo 'this works';}";
eval($str);

?>

 

It's important to say that eval() is not recommended. Maybe if you will explain what you are trying exactly to do we will find a better way.

 

Orio.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.