Jump to content

java php variable question.....


stlbelieve

Recommended Posts

in php 5, i have....

$my_variablle_results = shell_exec("call my java program");

and the java program does either: System.out.println("SUCCESS"); or System.out.println("FAILURE"); 

it works fine, and if I echo $my_variable_results, i see "SUCCESS" and "FAILURE" like one would expect.

But, if i then do (in php)

if($my_variable_results == "SUCCESS")    // with single or double quotes...

{ echo "it is a success";}    else    { echo "no success"; }

 

"no success" get's printed, even when the echo of $my_variable_results is SUCCESS

Is there something with the format or datatype that could cause this comparison to fail?  i tried declaring declaring it first like:  $my_variable_results = 'test';

before calling  the java program... didn't help.  i am using java 1.4.2 which is pretty old, but i doubt that would be problematic.

any ideas?

thanks,

mike.

Link to comment
https://forums.phpfreaks.com/topic/117394-java-php-variable-question/
Share on other sites

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.