f



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?

0
lkrubner (905)
5/22/2006 4:11:01 AM
comp.lang.php 32646 articles. 0 followers. Post Follow

3 Replies
961 Views

Similar Articles

[PageSpeed] 24

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.

0
lkrubner (905)
5/22/2006 5:18:11 AM
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

0
5/22/2006 6:17:46 AM
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

0
lkrubner (905)
5/23/2006 6:38:57 PM
Reply:

Similar Artilces:

what does SHIFT-left-or-right of up-down-left-right do?
Well, I know about shift up-and-down: shift-right ("red" or whatever) up and down on choose-box, HIST, things like that, take the cursor all the way to the beginning or the end. shift-left ("white") on up and down scroll the screen-full up or down (the FIRST such click *stupidly* goes to the final CURRENTLY-ON-SCREEN choice or whatever (meaning TWO double-button-pushes to scroll-down that FIRST time.) What are some of the OTHER possibilities, ie with the left and right arrows? Oh, apparantely undocumented, I&#...

LEFT + LEFT vs LEFT + RIGHT
In order to do a full outer join in MySQL one must use a union. Is there any good reason to do SELECT ... LEFT JOIN UNION SELECT ... RIGHT JOIN rather than SELECT ... LEFT JOIN UNION SELECT ... LEFT JOIN with the tables swapped on the latter LEFT JOIN? Paul Lautman wrote: > In order to do a full outer join in MySQL one must use a union. > Is there any good reason to do > > SELECT ... > LEFT JOIN > > UNION > > SELECT ... > RIGHT JOIN > > rather than > > SELECT ... > LEFT JOIN > > UNION > > SELECT ... > LEFT JOIN > ...

Changing x-axis plot from right to left to left to right
Hi, For mathematical reasons, I need to change the way that gnuplots my data along the X axis from right to left to left to right (that is, at the minute it plots from 20 down to 1, not from 1 to 20) I am aware of set xrange reverse but this just inverts the whole graph and displays from 17 .... 1 down along the x-axis rather than plotting the other way round. I'm rather stuck and would appreciate some advice. Regards Jamie On 14.08.2012 17:52, Jamie Rees wrote: > For mathematical reasons, I need to change the way that gnuplots my > data along the X axis from ri...

Text widget with mixed left-to-right and right-to-left Unicode text abilities?
Hi, is there one of these? If not I might have a go at writing a simple one of them.... Apologies if this is a FAQ, I did search the archive a bit before posting. Best, Charles. ...

Skybuck presents ShiftLeft( Left, Right, Shift ) and ShiftRight( Right, Left, Shift )
Hello, I think these two functions will come in very handy to solving the "write longword bits" problem. ShiftLeft( Left, Right, Shift ) ShiftRight( Right, Left, Shift ) Shifting with extra inputs is what is required to solve it nicely. // Begin of Code *** program Project1; {$APPTYPE CONSOLE} { Skybuck presents ShiftLeft( Left, Right, Shift ) and ShiftRight( Right, Left, Shift ) version 0.01 created on 5 may 2008 by Skybuck Flying. Be carefull though, the shift parameter must be 0 to 31. } uses SysUtils; // make overloaded versions for easy coding // display in big e...

Changing M-<right,left> to C-<right,left>
Hello, I tried to change the word moving behaviour as shown in the post title and could not. Part of my .emacs is below. (global-set-key (kbd "C-z") 'undo) (global-set-key (kbd "C-<right>") 'forward-word) (global-set-key (kbd "C-<left>") 'backward-word) Finally, how could I open a new buffer proportionally in the same window? For instance, if I open a new buffer with C-x 2 and then open the new buffer the window is split in two equal halves. I'd prefer to have it 70%, 30%. TIA, Andre Luiz AndreLTR <andreltramos@gma...

Read a variable from Right to Left
Hi All, I want help to substring a variable from right to left, for eg: I have a SAS data set which has a variable Address like. Address 114, Mills Rd, Apt 202 345 Morris Drive, Apt 345 Chestnut Avenue Apt # 987 Is there a way I can create a variable say Type like Type Apt202 Apt345 pt#987 Thanks, Richie Richie: Try the following. I assume there is a comma before "Apt # 987" in your third address. Output follows the code. data temp; input; Type=scan(_infile_,-1,","); datalines; 114, Mills Rd, Apt 202 345 Morris Drive, Apt 345 Chestnut Avenue, Apt # 987 ...

Right or Left ?
A simple multimedia setup can be a display monitor with speakers positioned on both sides. Think of this equipment as being on a 'stage' in a theater, and the user as being the 'audience' in that theater. What is called the "left" speaker -- is it the one on the left of the audience (as viewed by the audience), or the one on the left of the stage (as viewed by an actor standing ON the stage, facing out towards the audience) ? mikus Sir: Mikus Grinbergs wrote: > A simple multimedia setup can be a display monitor with > speakers positioned on...

How to read a CSV file from right to left
Hi, Can anyone tell me how to read a .CSV file from right to left? I know its bit awkward as most of you will think as what difference it will make. Actually, my raw data is something like this: ID,SOURCE,Var1,Var2......V275 The Id is unique but unfortunately the SOURCE contains values which are comma separated. So my code to import to SAS go for a toss as for one observation there can be three source while in other there can be 20 source. And in my raw file the values for each variable is not enclosed within quotes(""). However I don't want this variable (SOURCE) in my analy...

Re: Read a variable from Right to Left
On Tue, 21 Mar 2006 14:53:59 -0800, Richie <gsingh24@GMAIL.COM> wrote: >Hi All, > >I want help to substring a variable from right to left, for eg: I have >a SAS data set which has a variable Address like. > >Address > >114, Mills Rd, Apt 202 >345 Morris Drive, Apt 345 >Chestnut Avenue Apt # 987 > >Is there a way I can create a variable say Type like > >Type > >Apt202 >Apt345 >pt#987 > >Thanks, >Richie The simple answer is to provide a negative value for the second parameter of the scan() function. data demo ; string = ...

Are you Left or Right?
Take the test http://www.politicalcompass.org/ Robs score, which surprised me a bit Economic Left/Right: 1.38 Social Libertarian/Authoritarian: -0.21 Shit, wrong group sorry "rob" <roball@xtra.co.nz> wrote in message news:t2vJd.11457$mo2.882985@news.xtra.co.nz... > Take the test > > http://www.politicalcompass.org/ > > Robs score, which surprised me a bit > Economic Left/Right: 1.38 > Social Libertarian/Authoritarian: -0.21 > "rob" <roball@xtra.co.nz> wrote in message news:t2vJd.11457$mo2.882985@news...

left, right?
What function returns some number of characters on the right or left of a string? i.e. if I have the string 'filename', is there a command like Left('filename',4) = file? Thanks. asdd12 wrote: > > > What function returns some number of characters on the right or > left > of a string? i.e. if I have the string 'filename', is there a > command > like Left('filename',4) = file? Thanks. >> f='filename' f = filename >> f(1:4) ans = file In article <ef4d6a8.-1@webcrossing.raydaftYaTP>, nospam@nospam.com says... &...

Align javascript alert message to right AND / OR make the direction as RIGHT-TO-LEFT
Dear Friends, I am wondering, how can i show Alert() messages includes text aligned to the right of the message box on the screen. i am looking for something like the "\n" to do this. additionally, How can i show the same message in a Right-To-Left format. Best Regards, Oran MEIR Hi Oran As far as I know you can't script the MS alert box. The good news is that you can build your own and use CSS to make the content right to left and text align to the right. I assume your content is Hebrew and you have stopped using the old backward font system for HTML. ;>) Then again ...

Re: Read a variable from Right to Left #2
...many questions left, about what you REALLY want... If it's so simple like "substr from right to left" I'd suggest something like reverse(substr(left(reverse(string)),1,9) On Tue, 21 Mar 2006 16:31:09 -0800, David L Cassell <davidlcassell@MSN.COM> wrote: >gsingh24@GMAIL.COM wrote: >>I want help to substring a variable from right to left, for eg: I have >>a SAS data set which has a variable Address like. >> >>Address >> >>114, Mills Rd, Apt 202 >>345 Morris Drive, Apt 345 >>Chestnut Avenue Apt # 987 >> >&...

Web resources about - does PHP read left to right or right to left? - comp.lang.php

Hillary on huge speaking fees: “That’s what they offered”
By way of a disclaimer, I didn’t watch the Democrats’ town hall last night. (I’ve been sick since Tuesday, sorry.) It doesn’t sound like I missed ...

Toyota's Super Bowl ad wants to make the Prius badass in its own geeky way
A Super Bowl ad for the Toyota Prius this Sunday will make no mention of its gas mileage efficiency, its hybrid engine or its eco-friendliness ...

Spotify users can now listen to their music on Amazon Echo
Echo , Amazon's voice-controlled, wireless home speaker, can now play your Spotify tunes The new feature, available for Spotify Premium subscribers ...

Criminal case against Bill Cosby to proceed, judge rejects motion to dismiss
Earlier this week Bill Cosby appeared in court in Norristown, PA to face charges on a 2004 sexual assault on the former director of the Temple ...

Taylor Swift Adores Camila Cabello, Admits ‘I Want To Be In Fifth Harmony’
Taylor Swift and Fifth Harmony singer Camila Cabello have a special bond as the gal pals have been hanging out during each singer’s hiatus from ...

Trump on Obama: 'Maybe he feels comfortable' at mosque
KTUU.com Trump on Obama: 'Maybe he feels comfortable' at mosque KTUU.com Donald Trump revived questions of President Barack Obama's religion ...

Julian Assange Being Arbitrarily Held: United Nations
TIME Julian Assange Being Arbitrarily Held: United Nations TIME The United Nations panel deciding whether Julian Assange is being arbitrarily ...

Hell, yeah, Amazon should open more bookstores
There is collective head-scratching across the InterWebs about a Wall Street Journal report that Amazon will open as many as 300, or even 400, ...

Cisco-Jasper deal should make enterprise IoT safer
Cisco Systems' planned $1.4 billion acquisition of Jasper Technologies could make it easier for enterprises to build businesses around services ...

At CBS, Sumner Redstone is out and Les Moonves is in
CBS announced today that ailing and aging media mogul Sumner M. Redstone, who is 92, has resigned as the company's executive chairman. Leslie ...

Resources last updated: 2/4/2016 2:57:50 PM