Hi guys,
Would appreciate some help with a problem when running eval() on a function that should return true or false.
From php.net:
Quoteeval() returns NULL unless return is called in the evaluated code, in which case the value passed to return is returned.
Not sure if I'm missing something here but the following code illustrates that the function returns true/false as expected when run directly. However, the same function run using eval() never returns true:
Code: <?php
// Function to test what eval() returns...
function test()
{
$test = rand(1, 3);
return ($test === 1) ? TRUE : FALSE;
}
$eval = "test();";
$test = eval($eval); # expect this should set $test to TRUE for 1 in 3 attempts
echo ($test) ? 'eval returned true' : 'eval returned FALSE or NULL <br />';
// Now retest the function by calling it directly, not through eval...
$test2 = test();
echo ($test2) ? 'test returned TRUE' : 'test returned FALSE or NULL <br />'; # this behaves as expected...
?>
Hopefully it's something ridiculously obvious to someone out there...
my code does not work.
I have a code problem.Quote"<a href=index.php?gogo=ureticidetay&'?l={$letter}'>{$ letter}</a>" this is not working. but need link like this
Displaying returned XML in another PHP page
I have an online payment form that will return XML given if a payment is successful or declines. I am using PHP cURL to do this, and it all works from the standpoint of approving or denying
PHP and XML image gallery variable issue
I'm trying to display the large image on the same page as the thumbnails, to do that I'm passing a variable called $current. I know that the code to display large image works, because it works when no
NOOB needs help with upload file
The intent of this form is to create a folder for a client and upload an image into another folder 'imagesClients'. The form works as follows: Username: selected from drop down menu.Folder: Slide
Help, Base64 encoding url and decoding server side.
Hello everyone, i have a website with videos and games and also provide an embed code which people can use to embed the games and videos on their website.My problem is that alot of people would embed
error checking breaking my code
Hi there, OK first of all, big apologies for what I assume is really fundamental errors in the structure of my code. I'm really new at this and still learning, but I'm almost at the stage of giving up
Gantt Chart Tool
Does anyone know of a good free gantt chart creator toolThanks
IIS7 and getimagesize() problem
I have just discovered after hrs of trying to fix a problem where it's coming from. It's to do with the php function getimagesize() and path names.When using these two different sets of code:Code:
Connection Timeout
I'm using xmii 12.0
imap: how to save a copy of sent emails to sent elements
Hello my friends,I am writing an online emailing application with inbox outbox/sent elements etc.When I send and email with mail() function, what would I do in order to save to the sent