does PHP read left to right or right to left?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • lawrence k

    #1

    does PHP read left to right or right to left?

    I've two functions. currentHeadline looks in $_GET for a variable
    called 'image' and prints what it finds. showThumbnail takes an image
    for a parameter and resizes it before sending it to the screen. But
    when I do this:

    <?php showThumbnail(c urrentImage(), 20, 20); ?>

    showThumbnail is telling me that it is not being given a file name, and
    currentImage is printing the file name to the screen. How is that
    possible? What is the right way to do this?

  • lawrence k

    #2
    Re: does PHP read left to right or right to left?


    lawrence k wrote:[color=blue]
    > I've two functions. currentHeadline looks in $_GET for a variable
    > called 'image' and prints what it finds. showThumbnail takes an image
    > for a parameter and resizes it before sending it to the screen. But
    > when I do this:
    >
    > <?php showThumbnail(c urrentImage(), 20, 20); ?>
    >
    > showThumbnail is telling me that it is not being given a file name, and
    > currentImage is printing the file name to the screen. How is that
    > possible? What is the right way to do this?[/color]

    Nevermind, I'm an idiot. currentImage was echoing its result to the
    screen instead of returning it.

    Comment

    • Toby Inkster

      #3
      Re: does PHP read left to right or right to left?

      lawrence k wrote:
      [color=blue]
      > I've two functions. currentHeadline looks in $_GET for a variable
      > called 'image' and prints what it finds. showThumbnail takes an image
      > for a parameter and resizes it before sending it to the screen. But
      > when I do this:
      >
      > <?php showThumbnail(c urrentImage(), 20, 20); ?>[/color]

      currentImage() will execute before showThumbnail() .

      When you say "prints what it finds", do you really mean "returns what it
      finds"? If you're not 100% sure of what the difference between these two
      phrases is, then post the source code for currentImage().

      --
      Toby A Inkster BSc (Hons) ARCS
      Contact Me ~ http://tobyinkster.co.uk/contact

      Comment

      • lawrence k

        #4
        Re: does PHP read left to right or right to left?


        Toby Inkster wrote:[color=blue]
        > lawrence k wrote:
        >[color=green]
        > > I've two functions. currentHeadline looks in $_GET for a variable
        > > called 'image' and prints what it finds. showThumbnail takes an image
        > > for a parameter and resizes it before sending it to the screen. But
        > > when I do this:
        > >
        > > <?php showThumbnail(c urrentImage(), 20, 20); ?>[/color]
        >
        > currentImage() will execute before showThumbnail() .
        >
        > When you say "prints what it finds", do you really mean "returns what it
        > finds"? If you're not 100% sure of what the difference between these two
        > phrases is, then post the source code for currentImage().[/color]

        Sorry, I was an idiot. currentImage was using echo instead of returning
        the string I expected it to return

        Comment

        Working...