piping output from PHP file into variable

Hi.

I have a script like so:

#!/bin/bash

download='php /var/www/last.php'
echo $download
if $download

How do I pipe the output of the php file into a variable, as when i run the if statement, it just echos the file output to the screen and does not actually consider the output (it will be either a 1 or 0).

Thanks.

so you wanna catch the return code(status code) taht is "$?" ??

php /var/www/last.php
echo $?
if [ $? -eq 0 ]

yeh, its working now, thanks anyway!

download=$(php /var/www/last.php) 

if test $download -eq 1