Re: [PHP] echo?

2011-03-22 Thread David Harkness
Are you sure? $ php -a php > for ($i = 0; $i < 10; $i++) { echo $i . ' '; } 0 1 2 3 4 5 6 7 8 9 David

Re: [PHP] echo?

2011-03-22 Thread Robert Cummings
On 11-03-22 06:22 PM, Jim Giner wrote: Kinda new to this, but I've been puttering/writing for about 3 weeks now and have some good working screens up. Ran into something new while I was debuggina script today. Tried to echo the $i value within a for loop as part of the list of items I was buil

Re: [PHP] echo?

2011-03-22 Thread Daniel Brown
On Tue, Mar 22, 2011 at 18:22, Jim Giner wrote: [snip!] > > for ($i=0;$i<$rows;$i++) >    echo $i.' '.$row['itemname']; > > I expected to see : > > 1 item1 > 2 item2 > ... > ... > > but instead I got > > 1 item1 > f item2 > > Yes - an 'f' and not a 2. > > Tried it some more with this: > > for ($i=

Re: [PHP] echo SESSION var doesn't work if unset after echo

2008-12-09 Thread Ashley Sheridan
On Tue, 2008-12-09 at 16:51 -0500, Eric Wood wrote: > I have two vars doing the same thing. One is echo'd/unset in the > section and the other echo'd/unset in the footer of the page. > No re-direct request is being made. > > Ok now check this. If I use this code: > > if(isset($_SESSION["Ec

Re: [PHP] echo SESSION var doesn't work if unset after echo

2008-12-09 Thread Eric Wood
I have two vars doing the same thing. One is echo'd/unset in the section and the other echo'd/unset in the footer of the page. No re-direct request is being made. Ok now check this. If I use this code: if(isset($_SESSION["Ecomm"])) { echo $_SESSION["Ecomm"]; unset($_SESSION["Ecomm"]);

Re: [PHP] echo SESSION var doesn't work if unset after echo

2008-12-09 Thread Tim | iHostNZ
On Wed, Dec 10, 2008 at 8:11 AM, <[EMAIL PROTECTED]> wrote: > > Fire up Live HTTP Headers in Firefox. > Where is this "Live HTTP Headers in Firefox"? Is it an extension? > > My theory is that the browser is RE-requesting the data because of the > private, must-revalidate. > > So it goes like this

Re: [PHP] echo SESSION var doesn't work if unset after echo

2008-12-09 Thread Ashley Sheridan
On Tue, 2008-12-09 at 19:11 +, [EMAIL PROTECTED] wrote: > Fire up Live HTTP Headers in Firefox. > > > > My theory is that the browser is RE-requesting the data because of the > private, must-revalidate. > > > > So it goes like this: > > > > Browser -> GET -> Ecomm: fooie ; unset Ecomm

Re: [PHP] echo SESSION var doesn't work if unset after echo

2008-12-09 Thread ceo
Fire up Live HTTP Headers in Firefox. My theory is that the browser is RE-requesting the data because of the private, must-revalidate. So it goes like this: Browser -> GET -> Ecomm: fooie ; unset Ecomm Browser -> GET -> Ecomm: [not set] If you are using Ajax and JS and whatnot, the p

Re: [PHP] Echo in __GET()

2008-08-05 Thread Micah Gersten
You can write 2 functions to handle this. Value and OutputValue Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com Tyler C. wrote: > Is the a way to have an array, or use __get() to provide different > data if you are echoing a variable, rather than if you are

Re: [PHP] echo returnArray()['a']; // workaround

2008-05-24 Thread Nitsan Bin-Nun
Nice trick, I will remember this one. Thanks for sharing, Nitsan On 23/05/2008, Nathan Nobbe <[EMAIL PROTECTED]> wrote: > > On Fri, Feb 29, 2008 at 12:16 AM, Nathan Nobbe <[EMAIL PROTECTED]> > wrote: > > > wow, im going to have to stare at some of those and play around with them > > as soon as im

Re: [PHP] echo returnArray()['a']; // workaround

2008-05-22 Thread Nathan Nobbe
On Fri, Feb 29, 2008 at 12:16 AM, Nathan Nobbe <[EMAIL PROTECTED]> wrote: > wow, im going to have to stare at some of those and play around with them > as soon as im half awake :) > > of course i still like my solution ;) but im excited about the > experimentation and ideas that have been shared

Re: [PHP] echo returnArray()['a']; // workaround

2008-02-29 Thread Shawn McKenzie
Nathan Rixham wrote: > Nathan Nobbe wrote: >> On Thu, Feb 28, 2008 at 6:14 PM, Nathan Rixham <[EMAIL PROTECTED]> wrote: >> >>> if I show you guys how to do this: >>> >>> echo sillyFunc()['a'] . PHP_EOL; >>> >>> using a few brackets and things do you promise not to laugh? >>> *it's a bit weird* >> >

Re: [PHP] echo returnArray()['a']; // workaround

2008-02-28 Thread Nathan Nobbe
wow, im going to have to stare at some of those and play around with them as soon as im half awake :) of course i still like my solution ;) but im excited about the experimentation and ideas that have been shared on this topic, very interesting really! -nathan

Re: [PHP] echo returnArray()['a']; // workaround

2008-02-28 Thread Robert Cummings
On Fri, 2008-02-29 at 05:34 +, Nathan Rixham wrote: > Casey wrote: > > > > I don't know why I'm continuing this... but for the truly crazy: > > function w(&$t) { > > $t = array('f' => '...'); > > return 't'; > > } > > > > echo ${w($t)}['f']; > > > >

Re: [PHP] echo returnArray()['a']; // workaround

2008-02-28 Thread Nathan Rixham
Casey wrote: I don't know why I'm continuing this... but for the truly crazy: function w(&$t) { $t = array('f' => '...'); return 't'; } echo ${w($t)}['f']; addictive isn't it! casey, I truelly believe that's as short as it can

Re: [PHP] echo returnArray()['a']; // workaround

2008-02-28 Thread Casey
On Thu, Feb 28, 2008 at 8:42 PM, Casey <[EMAIL PROTECTED]> wrote: > > On Thu, Feb 28, 2008 at 8:38 PM, Nathan Rixham <[EMAIL PROTECTED]> wrote: > > > > Robert Cummings wrote: > > > On Thu, 2008-02-28 at 23:27 -0500, Robert Cummings wrote: > > >> On Fri, 2008-02-29 at 04:04 +, Nathan Rixha

Re: [PHP] echo returnArray()['a']; // workaround

2008-02-28 Thread Robert Cummings
On Thu, 2008-02-28 at 20:42 -0800, Casey wrote: > On Thu, Feb 28, 2008 at 8:38 PM, Nathan Rixham <[EMAIL PROTECTED]> wrote: > > > > Robert Cummings wrote: > > > On Thu, 2008-02-28 at 23:27 -0500, Robert Cummings wrote: > > >> On Fri, 2008-02-29 at 04:04 +, Nathan Rixham wrote: > > >>> Rober

Re: [PHP] echo returnArray()['a']; // workaround

2008-02-28 Thread Casey
On Thu, Feb 28, 2008 at 8:38 PM, Nathan Rixham <[EMAIL PROTECTED]> wrote: > > Robert Cummings wrote: > > On Thu, 2008-02-28 at 23:27 -0500, Robert Cummings wrote: > >> On Fri, 2008-02-29 at 04:04 +, Nathan Rixham wrote: > >>> Robert Cummings wrote: > On Fri, 2008-02-29 at 00:18 +,

Re: [PHP] echo returnArray()['a']; // workaround

2008-02-28 Thread Robert Cummings
On Fri, 2008-02-29 at 04:38 +, Nathan Rixham wrote: > Robert Cummings wrote: > > On Thu, 2008-02-28 at 23:27 -0500, Robert Cummings wrote: > >> On Fri, 2008-02-29 at 04:04 +, Nathan Rixham wrote: > >>> Robert Cummings wrote: > On Fri, 2008-02-29 at 00:18 +, Nathan Rixham wrote: > >

Re: [PHP] echo returnArray()['a']; // workaround

2008-02-28 Thread Nathan Rixham
Robert Cummings wrote: On Thu, 2008-02-28 at 23:27 -0500, Robert Cummings wrote: On Fri, 2008-02-29 at 04:04 +, Nathan Rixham wrote: Robert Cummings wrote: On Fri, 2008-02-29 at 00:18 +, Nathan Rixham wrote: don't say I didn't warn ya fellow nathan! #!/usr/bin/php 1, 'b' => 2, 'c' =

Re: [PHP] echo returnArray()['a']; // workaround

2008-02-28 Thread Robert Cummings
On Thu, 2008-02-28 at 23:27 -0500, Robert Cummings wrote: > On Fri, 2008-02-29 at 04:04 +, Nathan Rixham wrote: > > Robert Cummings wrote: > > > On Fri, 2008-02-29 at 00:18 +, Nathan Rixham wrote: > > >> don't say I didn't warn ya fellow nathan! > > >> > > >> #!/usr/bin/php > > >> > >> fu

Re: [PHP] echo returnArray()['a']; // workaround

2008-02-28 Thread Robert Cummings
On Fri, 2008-02-29 at 04:04 +, Nathan Rixham wrote: > Robert Cummings wrote: > > On Fri, 2008-02-29 at 00:18 +, Nathan Rixham wrote: > >> don't say I didn't warn ya fellow nathan! > >> > >> #!/usr/bin/php > >> >> function sillyFunc() { > >>return array('a' => 1, 'b' => 2, 'c' => 3, 'd

Re: [PHP] echo returnArray()['a']; // workaround

2008-02-28 Thread Nathan Rixham
Robert Cummings wrote: On Fri, 2008-02-29 at 00:18 +, Nathan Rixham wrote: don't say I didn't warn ya fellow nathan! #!/usr/bin/php 1, 'b' => 2, 'c' => 3, 'd' => 4, 'e'=>'some string'); } echo !${~${''}='sillyFunc'}=&${''}().${~${''}}['e'] . PHP_EOL; I was ready to use this system eve

Re: [PHP] echo returnArray()['a']; // workaround

2008-02-28 Thread Nathan Rixham
Robert Cummings wrote: On Fri, 2008-02-29 at 00:18 +, Nathan Rixham wrote: don't say I didn't warn ya fellow nathan! #!/usr/bin/php 1, 'b' => 2, 'c' => 3, 'd' => 4, 'e'=>'some string'); } echo !${~${''}='sillyFunc'}=&${''}().${~${''}}['e'] . PHP_EOL; I was ready to use this system eve

Re: [PHP] echo returnArray()['a']; // workaround

2008-02-28 Thread Robert Cummings
On Fri, 2008-02-29 at 00:18 +, Nathan Rixham wrote: > > don't say I didn't warn ya fellow nathan! > > #!/usr/bin/php > function sillyFunc() { > return array('a' => 1, 'b' => 2, 'c' => 3, 'd' => 4, 'e'=>'some > string'); > } > > echo !${~${''}='sillyFunc'}=&${''}().${~${''}}['e'] . PHP

Re: [PHP] echo returnArray()['a']; // workaround

2008-02-28 Thread Nathan Rixham
Nathan Nobbe wrote: On Thu, Feb 28, 2008 at 6:14 PM, Nathan Rixham <[EMAIL PROTECTED]> wrote: if I show you guys how to do this: echo sillyFunc()['a'] . PHP_EOL; using a few brackets and things do you promise not to laugh? *it's a bit weird* id like to see it. -nathan don't say I didn'

Re: [PHP] echo returnArray()['a']; // workaround

2008-02-28 Thread Nathan Nobbe
On Thu, Feb 28, 2008 at 6:14 PM, Nathan Rixham <[EMAIL PROTECTED]> wrote: > if I show you guys how to do this: > > echo sillyFunc()['a'] . PHP_EOL; > > using a few brackets and things do you promise not to laugh? > *it's a bit weird* id like to see it. -nathan

Re: [PHP] echo returnArray()['a']; // workaround

2008-02-28 Thread Nathan Nobbe
On Thu, Feb 28, 2008 at 4:22 PM, Jim Lucas <[EMAIL PROTECTED]> wrote: > So, I guess my question would be, why not take it one level deeper. > > include('ArrayClass.php'); > > function sillyFunc() { > return ArrayClass::create(array('a' => 1, 'b' => 2, 'c' => 3, 'd' => > 4)); > } > > echo sil

Re: [PHP] echo returnArray()['a']; // workaround

2008-02-28 Thread Nathan Rixham
Nathan Nobbe wrote: On Thu, Feb 28, 2008 at 2:36 PM, Ray Hauge <[EMAIL PROTECTED]> wrote: That's pretty cool. I wasn't sure if it would work with numerically indexed arrays, so I tried: // sillyFunc returns array(0=>1, 1=>2); ArrayClass::create(sillyFunc())->{"0"} I just tested it, and that

Re: [PHP] echo returnArray()['a']; // workaround

2008-02-28 Thread Jim Lucas
Nathan Nobbe wrote: all, as we have discussed previously, php does not have support for retrieving array values on the same line in which they are returned. i have created a simple workaround, and would like to share. first there is the class (w/ other features omitted for the post) theArray =

Re: [PHP] echo returnArray()['a']; // workaround

2008-02-28 Thread Eric Butera
On Thu, Feb 28, 2008 at 2:16 PM, Nathan Nobbe <[EMAIL PROTECTED]> wrote: > all, > > as we have discussed previously, php does not have support for retrieving > array values on the same line in which they are returned. i have created a > simple workaround, and would like to share. first there i

Re: [PHP] echo returnArray()['a']; // workaround

2008-02-28 Thread Nathan Nobbe
On Thu, Feb 28, 2008 at 2:36 PM, Ray Hauge <[EMAIL PROTECTED]> wrote: > That's pretty cool. I wasn't sure if it would work with numerically > indexed arrays, so I tried: > > // sillyFunc returns array(0=>1, 1=>2); > > ArrayClass::create(sillyFunc())->{"0"} > > I just tested it, and that works. I

Re: [PHP] echo returnArray()['a']; // workaround

2008-02-28 Thread Ray Hauge
Nathan Nobbe wrote: all, as we have discussed previously, php does not have support for retrieving array values on the same line in which they are returned. i have created a simple workaround, and would like to share. first there is the class (w/ other features omitted for the post) theArray =

Re: [PHP] echo VS print : that's a cool behavior !

2007-10-23 Thread Julien Pauli
That's just the case : "too see what happens if ...". I agree that anyone will never meet such a case in everydays' programming. ;-) 2007/10/23, Andrew Ballard <[EMAIL PROTECTED]>: > > On 10/23/07, Robert Cummings <[EMAIL PROTECTED]> wrote: > > My bad, print is not a function, and so: > > > >

Re: [PHP] echo VS print : that's a cool behavior !

2007-10-23 Thread Andrew Ballard
On 10/23/07, Robert Cummings <[EMAIL PROTECTED]> wrote: > My bad, print is not a function, and so: > > print( 'toctoc ' ).'hihi '; > > is equivalent to: > > print( 'tocktoc '.'hihi ' ); > Ah. I see. I knew they were optional, but I didn't know that when you include them PHP evaluates ('toc

Re: [PHP] echo VS print : that's a cool behavior !

2007-10-23 Thread Robert Cummings
On Tue, 2007-10-23 at 11:54 -0400, Andrew Ballard wrote: > On 10/23/07, Robert Cummings <[EMAIL PROTECTED]> wrote: > > On Tue, 2007-10-23 at 17:34 +0200, Julien Pauli wrote: > > > > > echo "coucou " . print('v ' . print('u ' . print('toctoc ') . 'hihi > > > ') ) . > > > 'tata ' . print('zozo ' . p

RE: [PHP] echo VS print : that's a cool behavior !

2007-10-23 Thread Instruct ICC
> Hello everyone. > > We all know the difference between print and echo, but has someone ever > tried to combine them together ?? > > Right, try this : > > echo "coucou " . print('v ' . print('u ' . print('toctoc ') . 'hihi ') ) . > 'tata ' . print('zozo ' . print('pupu ')); > > > And guess

Re: [PHP] echo VS print : that's a cool behavior !

2007-10-23 Thread tedd
At 11:46 AM -0400 10/23/07, Robert Cummings wrote: On Tue, 2007-10-23 at 17:34 +0200, Julien Pauli wrote: That's not cool, that's a mess. Why doe sit happen the way it does? First off, print() is a function so nesting functions means the innermost functions get processed first, this is why th

Re: [PHP] echo VS print : that's a cool behavior !

2007-10-23 Thread Andrew Ballard
On 10/23/07, Robert Cummings <[EMAIL PROTECTED]> wrote: > On Tue, 2007-10-23 at 17:34 +0200, Julien Pauli wrote: > > > echo "coucou " . print('v ' . print('u ' . print('toctoc ') . 'hihi > > ') ) . > > 'tata ' . print('zozo ' . print('pupu ')); > > That's not cool, that's a mess. Why doe sit happe

Re: [PHP] echo VS print : that's a cool behavior !

2007-10-23 Thread Robert Cummings
On Tue, 2007-10-23 at 17:34 +0200, Julien Pauli wrote: > echo "coucou " . print('v ' . print('u ' . print('toctoc ') . 'hihi > ') ) . > 'tata ' . print('zozo ' . print('pupu ')); That's not cool, that's a mess. Why doe sit happen the way it does? First off, print() is a function so nesting functi

Re: [PHP] echo date('Y-m-d', $mydata->timestamp);

2007-04-24 Thread Richard Lynch
Use the MySQL function that converts timestamp into Unixtime. Or, better yet, use the MySQL function that outputs exactly the date format you want, without dinking around with Unix timestamp in the middle. http://dev.mysql.com/ Search for date_format() I do believe. It's gonna be a whole lot li

RE: [PHP] echo date('Y-m-d', $mydata->timestamp);

2007-04-22 Thread Buesching, Logan J
You are misunderstanding what timestamp means. The value of a timestamp is from UNIX epoch http://en.wikipedia.org/wiki/Unix_time. It is calculated by the number of seconds after January 1st, 1970. Also note, that you are overflowing the integer, which is giving you a http://en.wikipedia.org/wik

Re: [PHP] echo date('Y-m-d', $mydata->timestamp);

2007-04-22 Thread Jochem Maas
John Taylor-Johnston wrote: > > It is actually a generated timestamp in MySQL. > timestamp(14) > Now what? I was hoping to avoid: > |echo substr(|$mydata->timestamp|, 0, 8); the simplest answer is actually yto make mySQL give you the data in unix timestamp format in the first place: SELECT UNIX_

Re: [PHP] echo date('Y-m-d', $mydata->timestamp);

2007-04-22 Thread Børge Holen
On Sunday 22 April 2007 08:33, John Taylor-Johnston wrote: > It is actually a generated timestamp in MySQL. > timestamp(14) Well, then just use the query to decide how it should look like. Mysql timestamp is amazingly easy to work with. whatevertable,date_format(timestamp_table, 'what should it lo

Re: [PHP] echo date('Y-m-d', $mydata->timestamp);

2007-04-21 Thread John Taylor-Johnston
It is actually a generated timestamp in MySQL. timestamp(14) Now what? I was hoping to avoid: |echo substr(|$mydata->timestamp|, 0, 8); John |Richard Lynch wrote: On Sun, April 22, 2007 1:05 am, John Taylor-Johnston wrote: $mydata->timestamp = "20070419162123"; echo date('Y-m-d', $mydata-

Re: [PHP] echo date('Y-m-d', $mydata->timestamp);

2007-04-21 Thread Richard Lynch
On Sun, April 22, 2007 1:05 am, John Taylor-Johnston wrote: > $mydata->timestamp = "20070419162123"; > > echo date('Y-m-d', $mydata->timestamp); > > > result: 2038-01-18 > > ?? What is wrong?? Should be 2007-04-19? date() takes a Unix timestamp as its input. Unix timestamps are measured as number

Re: [PHP] echo or print ?

2007-04-21 Thread Richard Lynch
On Sat, April 21, 2007 5:20 pm, Tijnema ! wrote: > But what else would you use a lot in your code? > all commonly used things (like while, if, echo, etc) are just (nearly) > as fast as their alternatives (for, print, etc). > Other functions (like file/stream) might be some performance > difference,

Re: [PHP] echo or print ?

2007-04-21 Thread Stut
Tijnema ! wrote: On 4/22/07, Stut <[EMAIL PROTECTED]> wrote: Tijnema ! wrote: > But what else would you use a lot in your code? > all commonly used things (like while, if, echo, etc) are just (nearly) > as fast as their alternatives (for, print, etc). > Other functions (like file/stream) might b

Re: [PHP] echo or print ?

2007-04-21 Thread Tijnema !
On 4/22/07, Stut <[EMAIL PROTECTED]> wrote: Tijnema ! wrote: > But what else would you use a lot in your code? > all commonly used things (like while, if, echo, etc) are just (nearly) > as fast as their alternatives (for, print, etc). > Other functions (like file/stream) might be some performance

Re: [PHP] echo or print ?

2007-04-21 Thread Stut
Tijnema ! wrote: But what else would you use a lot in your code? all commonly used things (like while, if, echo, etc) are just (nearly) as fast as their alternatives (for, print, etc). Other functions (like file/stream) might be some performance difference, but you probably use this only a few ti

Re: [PHP] echo or print ?

2007-04-21 Thread Tijnema !
On 4/21/07, Stut <[EMAIL PROTECTED]> wrote: Tijnema ! wrote: > On 4/21/07, Stut <[EMAIL PROTECTED]> wrote: >> Tijnema ! wrote: >> > There is a difference, echo is slightly faster. >> > code used for benchmark: >> > > > $start = microtime(TRUE); >> > for ($i=0; $i<10; ++$i) { print "ABC"; } >>

Re: [PHP] echo or print ?

2007-04-21 Thread Stut
Tijnema ! wrote: On 4/21/07, Stut <[EMAIL PROTECTED]> wrote: Tijnema ! wrote: > There is a difference, echo is slightly faster. > code used for benchmark: > $start = microtime(TRUE); > for ($i=0; $i<10; ++$i) { print "ABC"; } > echo sprintf("With print ($i): %0.3f\n",microtime(TRUE) - $star

Re: [PHP] echo or print ?

2007-04-21 Thread Tijnema !
On 4/21/07, Stut <[EMAIL PROTECTED]> wrote: Tijnema ! wrote: > On 4/18/07, Richard Lynch <[EMAIL PROTECTED]> wrote: >> On Tue, April 17, 2007 1:40 am, Christian Haensel wrote: >> > Whenever I see people put their code up for review, I realize they >> > mostly >> > use print instead of echo, while

Re: [PHP] echo or print ?

2007-04-21 Thread Stut
Tijnema ! wrote: On 4/18/07, Richard Lynch <[EMAIL PROTECTED]> wrote: On Tue, April 17, 2007 1:40 am, Christian Haensel wrote: > Whenever I see people put their code up for review, I realize they > mostly > use print instead of echo, while I am using echo 99% of the time. > Actually, > I can't e

Re: [PHP] echo or print ?

2007-04-21 Thread Tijnema !
On 4/18/07, Richard Lynch <[EMAIL PROTECTED]> wrote: On Tue, April 17, 2007 1:40 am, Christian Haensel wrote: > Whenever I see people put their code up for review, I realize they > mostly > use print instead of echo, while I am using echo 99% of the time. > Actually, > I can't even remember when

Re: [PHP] echo or print ?

2007-04-17 Thread Richard Lynch
On Tue, April 17, 2007 1:40 am, Christian Haensel wrote: > Whenever I see people put their code up for review, I realize they > mostly > use print instead of echo, while I am using echo 99% of the time. > Actually, > I can't even remember when I last used the regular print. There used to be a diff

Re: [PHP] echo or print ?

2007-04-17 Thread Christian Haensel
: Sent: Tuesday, April 17, 2007 9:48 AM Subject: Re: [PHP] echo or print ? On 4/17/07, Christian Haensel <[EMAIL PROTECTED]> wrote: Good morning fellow coders I've been working with PHP for a little over 5 years now, and it even got me a cute office and a good salary... but even t

Re: [PHP] echo or print ?

2007-04-17 Thread Dimiter Ivanov
On 4/17/07, Christian Haensel <[EMAIL PROTECTED]> wrote: Good morning fellow coders I've been working with PHP for a little over 5 years now, and it even got me a cute office and a good salary... but even though I can make a living off of it, I am still wondering about a few little things. When

Re: [PHP] echo or print ?

2007-04-17 Thread heavyccasey
Me too. I use echo. Print is a function. There's no significant difference between them. My advice: choose one, and stick with it. On 4/16/07, clive <[EMAIL PROTECTED]> wrote: > What do you guys use, and what is the advantage (if ther is any) of > print over echo? And I am not talking about pr

Re: [PHP] echo or print ?

2007-04-17 Thread clive
What do you guys use, and what is the advantage (if ther is any) of print over echo? And I am not talking about print_r or anything, just the regular print. :o) print returns a result, echo doesn't. This makes echo slightly faster than print, but I doubt theres any significant speed improvem

Re: [PHP] echo text - anti-spam-spider measure

2007-03-01 Thread Casey Chu
Richard Lynch wrote: > You could also use %XX in HEX on the mailto: you can actually randomly mix and match hex and entity encoding, which is what the function I posted elsewhere in the thread does. My function also does that: http://themfund.com/snippets/test.php On 3/1/07, Jochem Maas <[EM

Re: [PHP] echo text - anti-spam-spider measure

2007-03-01 Thread Jochem Maas
Richard Lynch wrote: > You could also use %XX in HEX on the mailto: you can actually randomly mix and match hex and entity encoding, which is what the function I posted elsewhere in the thread does. > > On Tue, February 27, 2007 11:09 pm, Casey Chu wrote: >> It works. =P I tested it. >> >> Try i

Re: [PHP] echo text - anti-spam-spider measure

2007-02-28 Thread Casey Chu
http://themfund.com/snippets/test.php Has %HEX, &#entity;, and even a entity version of the hex! On 2/28/07, Richard Lynch <[EMAIL PROTECTED]> wrote: On Wed, February 28, 2007 1:20 am, Stut wrote: > Of all the possible methods, entities are the easiest for bots to > handle. They just need to de

Re: [PHP] echo text - anti-spam-spider measure

2007-02-28 Thread Richard Lynch
On Wed, February 28, 2007 1:20 am, Stut wrote: > Of all the possible methods, entities are the easiest for bots to > handle. They just need to decode the entities. > > More reliable methods involve using javascript to write out the > mailto: > tag. Do it in several statements. But even then, some o

Re: [PHP] echo text - anti-spam-spider measure

2007-02-28 Thread Richard Lynch
You could also use %XX in HEX on the mailto: On Tue, February 27, 2007 11:09 pm, Casey Chu wrote: > It works. =P I tested it. > > Try it here! =P > > http://themfund.com/snippets/test.php > > On 2/27/07, Casey Chu <[EMAIL PROTECTED]> wrote: >> I'm not sure with both of your questions. I'm too lazy

Re: [PHP] echo text - anti-spam-spider measure

2007-02-28 Thread Richard Lynch
On Tue, February 27, 2007 10:22 pm, John Taylor-Johnston wrote: > I need an anti-spam-spider measure for my site. Too many addresses are > getting raked. In once instance, I created a flash page: > http://erasethis.glquebec.org/English/contact.htm > But I just don't have the time to create a flash

Re: [PHP] echo text - anti-spam-spider measure

2007-02-28 Thread John Taylor-Johnston
Can I PHP generate a flash *.swf? How? If not how do I PHP generate a *.png or gif? Jochem Maas wrote: Stut wrote: Of course the best way is to use an image and don't link it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] echo text - anti-spam-spider measure

2007-02-28 Thread Dave Goodchild
On 2/28/07, tedd <[EMAIL PROTECTED]> wrote: At 11:22 PM -0500 2/27/07, John Taylor-Johnston wrote: >I need an anti-spam-spider measure for my site. Too many addresses >are getting raked. In once instance, I created a flash page: >http://erasethis.glquebec.org/English/contact.htm >But I just don'

Re: [PHP] echo text - anti-spam-spider measure

2007-02-28 Thread tedd
At 11:22 PM -0500 2/27/07, John Taylor-Johnston wrote: I need an anti-spam-spider measure for my site. Too many addresses are getting raked. In once instance, I created a flash page: http://erasethis.glquebec.org/English/contact.htm But I just don't have the time to create a flash image for ever

Re: [PHP] echo text - anti-spam-spider measure

2007-02-28 Thread Jochem Maas
Stut wrote: > John Taylor-Johnston wrote: >> Neat, and thnaks. >> How spam-spider-proof is it? I will try this though. >> But I will also try it with "mailto:"; in entities as well. >> Thanks! >> John >> >> >> > href="mailto:me@somewhere.com";>me@somewhere.com >> >> > > Of all the possible metho

Re: [PHP] echo text - anti-spam-spider measure

2007-02-27 Thread Stut
John Taylor-Johnston wrote: Neat, and thnaks. How spam-spider-proof is it? I will try this though. But I will also try it with "mailto:"; in entities as well. Thanks! John href="mailto:me@somewhere.com";>me@somewhere.com Of all the possible methods, entities are the easiest for bots to h

Re: [PHP] echo text - anti-spam-spider measure

2007-02-27 Thread John Taylor-Johnston
Neat, and thnaks. How spam-spider-proof is it? I will try this though. But I will also try it with "mailto:"; in entities as well. Thanks! John mailto:me@somewhere.com";>me@somewhere.com Casey Chu wrote: It works. =P I tested it. Try it here! =P http://themfund.com/snippets/test.php On 2

Re: [PHP] echo text - anti-spam-spider measure

2007-02-27 Thread Casey Chu
Try using Javascript? Or use all entities? For example: mailto:php-general@lists.php.net would turn into mailto:php-general@lists.php.net On 2/27/07, John Taylor-Johnston <[EMAIL PROTECTED]> wrote: I need an anti-spam-spider measure for my site. Too many addresses are getting raked. In once in

Re: [PHP] echo text - anti-spam-spider measure

2007-02-27 Thread Casey Chu
^ So put that into a tag. On 2/27/07, Casey Chu <[EMAIL PROTECTED]> wrote: Try using Javascript? Or use all entities? For example: mailto:php-general@lists.php.net would turn into mailto:php-general@lists.php.net On 2/27/07, John Taylor-Johnston <[EMAIL PROTECTED]> wrote: > I need an anti-sp

Re: [PHP] echo text - anti-spam-spider measure

2007-02-27 Thread Casey Chu
It works. =P I tested it. Try it here! =P http://themfund.com/snippets/test.php On 2/27/07, Casey Chu <[EMAIL PROTECTED]> wrote: I'm not sure with both of your questions. I'm too lazy to try. Untested: But to encode it, you would use preg_replace_callback('~([\d\w])~', create_function('$a',

Re: [PHP] echo text - anti-spam-spider measure

2007-02-27 Thread Casey Chu
I'm not sure with both of your questions. I'm too lazy to try. Untested: But to encode it, you would use preg_replace_callback('~([\d\w])~', create_function('$a', 'return "&#".ord($a[0]).";";'), $theEmail); Hopefully that works? On 2/27/07, John Taylor-Johnston <[EMAIL PROTECTED]> wrote: How

Re: [PHP] echo text - anti-spam-spider measure

2007-02-27 Thread John Taylor-Johnston
How do I encode it? And would the href tag work? Casey Chu wrote: ^ So put that into a tag. On 2/27/07, Casey Chu <[EMAIL PROTECTED]> wrote: Try using Javascript? Or use all entities? For example: mailto:php-general@lists.php.net would turn into mailto:php-general@lists.php.net On 2/27/

Re: [PHP] ECHO

2006-12-19 Thread Jochem Maas
Fahad Pervaiz wrote: > ECHO is a language construct but still is there any work around to override > it or change its functionality??? if your willing to hack the php source then you can pretty much do whatever you want; that said there is no mechanism for overriding echo or any other language c

Re: [PHP] ECHO

2006-12-18 Thread Chris
Fahad Pervaiz wrote: ECHO is a language construct but still is there any work around to override it or change its functionality??? Nope. You're stuck with how it works now. -- Postgresql & php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscr

Re: [PHP] ECHO

2006-12-18 Thread Casey Chu
Why do you need to change its functionality? On 12/18/06, Fahad Pervaiz <[EMAIL PROTECTED]> wrote: ECHO is a language construct but still is there any work around to override it or change its functionality??? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www

Re: [PHP] ECHO $variable

2006-10-10 Thread benifactor
thank you for schooling me :) i learn something new everyday! - Original Message - From: "Richard Lynch" <[EMAIL PROTECTED]> To: "benifactor" <[EMAIL PROTECTED]> Cc: Sent: Monday, October 09, 2006 11:02 AM Subject: Re: [PHP] ECHO $variable > On Mon,

Re: [PHP] ECHO $variable

2006-10-09 Thread Richard Lynch
On Mon, October 9, 2006 7:45 am, benifactor wrote: > the way i posted worked fine with out either... he doesn't need to use > these > to format the way his output is displayed, he only needs to use the > proper > php syntax if i am correct. You were wrong, and you're still wrong. :-) Try it and s

Re: [PHP] ECHO $variable

2006-10-09 Thread Richard Lynch
On Sun, October 8, 2006 1:39 am, Ron Piggott (PHP) wrote: > In one of my scripts I have > > value=" $saved_message_title;?>"> > > where > > $saved_message_title is 1 Peter 5:7 "Cast all your cares on Him for He > cares about you" > --- note the " > > When this is displayed on the screen $saved_mes

Re: [PHP] ECHO $variable

2006-10-08 Thread John Wells
e quotes as well? Then your solution breaks anyway... Like Chris said, you should be using htmlentities for output... John W - Original Message - From: "Penthexquadium" <[EMAIL PROTECTED]> To: Sent: Sunday, October 08, 2006 1:41 AM Subject: Re: [PHP] ECHO $variable &g

Re: [PHP] ECHO $variable

2006-10-08 Thread Chris Shiflett
Ron Piggott wrote: > When this is displayed on the screen $saved_message_title reads > > 1 Peter 5:7 > > I am assuming the " closes the value= > > How may I echo this to the screen and have the full text be > displayed, not just 1 Peter 5:7 ? http://php.net/htmlentities You should really be u

Re: [PHP] ECHO $variable

2006-10-08 Thread benifactor
ober 08, 2006 1:41 AM Subject: Re: [PHP] ECHO $variable > On Mon, 9 Oct 2006 00:23:00 -0700, "benifactor" <[EMAIL PROTECTED]> wrote: > > you should try this... > > > > $saved_message_title = '1 Peter 5:7 "Cast all your cares on Him for He > > c

Re: [PHP] ECHO $variable

2006-10-08 Thread Penthexquadium
On Mon, 9 Oct 2006 00:23:00 -0700, "benifactor" <[EMAIL PROTECTED]> wrote: > you should try this... > > $saved_message_title = '1 Peter 5:7 "Cast all your cares on Him for He > cares about you"'; > - Original Message - > From: "Ron Piggott (PHP)" <[EMAIL PROTECTED]> > To: "PHP General" >

Re: [PHP] ECHO $variable

2006-10-08 Thread benifactor
you should try this... $saved_message_title = '1 Peter 5:7 "Cast all your cares on Him for He cares about you"'; - Original Message - From: "Ron Piggott (PHP)" <[EMAIL PROTECTED]> To: "PHP General" Sent: Saturday, October 07, 2006 11:39 PM Subject: [PHP] ECHO $variable > In one of my s

Re: [PHP] Echo a value from an arrays position

2006-05-07 Thread Jochem Maas
Dave Goodchild wrote: This may clarify - in php, integer and associate arrays are created arbitrarily, ie keys can be numbers or strings. So, either create an array like this: array('1' => 'first element', '2' => 'second element'); if I'm not mistaken the above example will result in an

Re: [PHP] Echo a value from an arrays position

2006-05-05 Thread Eric Butera
On 5/4/06, Brad Bonkoski <[EMAIL PROTECTED]> wrote: Will this also work with an associative array? If this is what he is talking about, I tried it and it does not work I put this together though and it works, not sure if it is the *best* way though... '#ff','black'=>'#00','blue'=>

Re: [PHP] Echo a value from an arrays position

2006-05-04 Thread Richard Lynch
On Thu, May 4, 2006 9:09 am, John Wells wrote: > On 5/4/06, Ford, Mike <[EMAIL PROTECTED]> wrote: >> They're not even that. They're pure associative arrays, or maps -- >> it's just that integer keys are treated somewhat specially so that >> an array with *only* integer keys will look like a traditi

Re: [PHP] Echo a value from an arrays position

2006-05-04 Thread Richard Lynch
On Thu, May 4, 2006 7:24 am, Jonas Rosling wrote: > Is there any way to call for an element value in an array by the > position? > Like position 2 in the array and not the key name. You DEFINITELY need to re-read the Array section of the manual. Because you either didn't read it, or didn't unders

Re: [PHP] Echo a value from an arrays position

2006-05-04 Thread John Wells
On 5/4/06, Ford, Mike <[EMAIL PROTECTED]> wrote: They're not even that. They're pure associative arrays, or maps -- it's just that integer keys are treated somewhat specially so that an array with *only* integer keys will look like a traditional array. True true, thanks for making it crystal

RE: [PHP] Echo a value from an arrays position

2006-05-04 Thread Ford, Mike
On 04 May 2006 13:52, John Wells wrote: > On 5/4/06, Brad Bonkoski <[EMAIL PROTECTED]> wrote: > > Will this also work with an associative array? If this is what he > > is talking about, I tried it and it does not work > > > > I think you're correct. This is because PHP arrays are a "mash-u

RE: [PHP] Echo a value from an arrays position

2006-05-04 Thread Jay Blanchard
[snip] > $colors = > array('white'=>'#ff','black'=>'#00','blue'=>'#ff'); > foreach($colors AS $key => $value){ > echo $value . "\n"; > } > But I don't get anything out of this code. Why? Doesn't echo anything? [/snip] Seriously? Works fine here. -- PHP General Mailing List (http://w

RE: [PHP] Echo a value from an arrays position

2006-05-04 Thread Jay Blanchard
[snip] Lasso can do the following, can PHP? Size; Output: '' + $Colors->(Get: Loop_Count),-EncodeNone; /Loop; ?> This outputs; ff 00ff00 ff I'm new at PHP but not Lasso that's why I'm for you asking odd questions. [/snip] 1. Always respond to the list as a single use

RE: [PHP] Echo a value from an arrays position

2006-05-04 Thread Jay Blanchard
[snip] Seem like your missunderstanding me. I'm not using an orignal array. I'm using an "map-array". $array = ('element' = 'value'); [/snip] It is called an associative array, a value is associated with a key. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.p

RE: [PHP] Echo a value from an arrays position

2006-05-04 Thread Jay Blanchard
[snip] Of course getting an indexed value into an associative array seems a bit odd to me... maybe Jonas could shed some light on why he would go this route... [/snip] Exactly [snip] To get a value from position 2 in an array you use $arrayName[1] (all array elements start numbering at 0,

Re: [PHP] Echo a value from an arrays position

2006-05-04 Thread John Wells
On 5/4/06, Brad Bonkoski <[EMAIL PROTECTED]> wrote: Will this also work with an associative array? If this is what he is talking about, I tried it and it does not work I think you're correct. This is because PHP arrays are a "mash-up" (as Jochem put it) of numerical indexes/hashtables/as

Re: [PHP] Echo a value from an arrays position

2006-05-04 Thread Dave Goodchild
This may clarify - in php, integer and associate arrays are created arbitrarily, ie keys can be numbers or strings. So, either create an array like this: array('1' => 'first element', '2' => 'second element'); and call by the key! On 04/05/06, Jonas Rosling <[EMAIL PROTECTED]> wrote: I

  1   2   3   >