does PHP read left to right or right to left?

This is a discussion on does PHP read left to right or right to left? within the PHP Language forums, part of the PHP Programming Forums category; I've two functions. currentHeadline looks in $_GET for a variable called 'image' and prints what it finds. showThumbnail takes ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 05-22-2006
lawrence k
 
Posts: n/a
Default 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(currentImage(), 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?

Reply With Quote
  #2 (permalink)  
Old 05-22-2006
lawrence k
 
Posts: n/a
Default Re: does PHP read left to right or right to left?


lawrence k wrote:
> 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(currentImage(), 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?


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

Reply With Quote
  #3 (permalink)  
Old 05-22-2006
Toby Inkster
 
Posts: n/a
Default Re: does PHP read left to right or right to left?

lawrence k wrote:

> 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(currentImage(), 20, 20); ?>


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

Reply With Quote
  #4 (permalink)  
Old 05-23-2006
lawrence k
 
Posts: n/a
Default Re: does PHP read left to right or right to left?


Toby Inkster wrote:
> lawrence k wrote:
>
> > 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(currentImage(), 20, 20); ?>

>
> 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().


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

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 01:30 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0