Re: [PHP] Differences

2012-10-03 Thread Rosalind Wills
On 10/3/12 9:57 PM, David McGlone wrote: Absolutely. I also think I learned that return can also work like echo if the code is written correctly. Echo and return are two completely different things in PHP. Echo is used for printing a value out in a document -- for instance, as follows, in the

Re: [PHP] Differences

2012-10-03 Thread tamouse mailing lists
On Wed, Oct 3, 2012 at 10:03 PM, tamouse mailing lists wrote: > On Wed, Oct 3, 2012 at 9:57 PM, David McGlone wrote: >> Absolutely. I also think I learned that return can also work like echo if the >> code is written correctly. > > > No, no, no. Return does NOT do the same thing as echo, nor vice

Re: [PHP] Differences

2012-10-03 Thread tamouse mailing lists
On Wed, Oct 3, 2012 at 9:57 PM, David McGlone wrote: > Absolutely. I also think I learned that return can also work like echo if the > code is written correctly. No, no, no. Return does NOT do the same thing as echo, nor vice versa. If you do try to make things work this way you are doing things

Re: [PHP] Differences

2012-10-03 Thread tamouse mailing lists
On Wed, Oct 3, 2012 at 9:01 PM, James wrote: > All of the images are displaying because you're simply instructing the > function to print out each file found with your call to glob(). The glob() > function returns an indexed array containing files found in the path you > specified, or an empty

Re: [PHP] Differences

2012-10-03 Thread David McGlone
On Wednesday, October 03, 2012 10:01:50 PM James wrote: > All of the images are displaying because you're simply instructing the > function to print out each file found with your call to glob(). The glob() > function returns an indexed array containing files found in the path you > specified, or an

Re: [PHP] Differences

2012-10-03 Thread David McGlone
On Thursday, October 04, 2012 03:01:12 AM Timmy Sjöstedt wrote: > Hi David, > > A "return" statement will immediately halt execution of the current > function and return to where it was called. > > In your case, the foreach loop will execute once and find a return > statement, and thus halting ex

Re: [PHP] Differences

2012-10-03 Thread James
All of the images are displaying because you're simply instructing the function to print out each file found with your call to glob(). The glob() function returns an indexed array containing files found in the path you specified, or an empty array if no files were found or false if glob() failed

Re: [PHP] Differences

2012-10-03 Thread David McGlone
On Wednesday, October 03, 2012 08:55:29 PM admin wrote: > > Hi everyone, I have been playing around with some code the list helped me > > with a while back and I'm not grasping the concept between return and echo > and the PHP manual doesn't answer this, unless I'm missing something. There > is an

RE: [PHP] Differences

2012-10-03 Thread admin
function filename($prefix) { $array_to_return = array(); $matches = glob('images/property_pics/'.$prefix.'*'); foreach($matches as $filename){ $array_to_return[] = $filename; } return $array_to_return; } If this better explains it. The first return will stop the process you need to

Re: [PHP] Differences

2012-10-03 Thread Timmy Sjöstedt
Hi David, A "return" statement will immediately halt execution of the current function and return to where it was called. In your case, the foreach loop will execute once and find a return statement, and thus halting execution of the function and returning only the first filename. echo() i

RE: [PHP] Differences

2012-10-03 Thread admin
> Hi everyone, I have been playing around with some code the list helped me with a while back and I'm not grasping the concept between return and echo and the PHP manual doesn't answer this, unless I'm missing something. There is an > example at the very bottom of PHP's return manual, but it's conf

[PHP] Differences

2012-10-03 Thread David McGlone
Hi everyone, I have been playing around with some code the list helped me with a while back and I'm not grasping the concept between return and echo and the PHP manual doesn't answer this, unless I'm missing something. There is an example at the very bottom of PHP's return manual, but it's confu

Re: [PHP] generate a thumbnail with imagick and place a logo on top

2012-10-03 Thread tamouse mailing lists
On Wed, Oct 3, 2012 at 10:54 AM, A Freund wrote: > Hello, > > I have a problem creating thumbnails with imagick. The code is working > ok and the thumbnail is generated in the right size etc but when I try > to place a PDF logo on the thumbnail it turns half transparent. I guess > it has something

[PHP] generate a thumbnail with imagick and place a logo on top

2012-10-03 Thread A Freund
Hello, I have a problem creating thumbnails with imagick. The code is working ok and the thumbnail is generated in the right size etc but when I try to place a PDF logo on the thumbnail it turns half transparent. I guess it has something to do with that the PDF file is generated in InDesign and pr