Jump to content

anonp

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

anonp's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi, Thank you for the responses. Yes, I can use the file functions, but it is not as clean as redirecting the output. Notice all the "\" added to the text. In addition, I cannot put complex statements such as the for-loop into a string. Basically, Yes, file functions will work, but I am hoping for a more elegant solution. Any other suggestion? Thanks
  2. Hello, In a .php file, text that is outside of <?php and ?> is output to either the client browser or stdout. Likewise, echo is output to the client browser or stdout. Is it possible to redirect this output to a file? I am using PHP to generate Java based on some input from the user. I want to save the output of my php into a .java file. For example: class HelloWorldApp { public static void main(String[] args) { //Display "Hello World!" System.out.println("<?php echo $some_user_input ?>"); <?php for ($i = 1; $i <= $some_other_input; $i++) { echo $i; } ?> } } Please help. Thanks
×
×
  • 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.