php-general Digest 12 Apr 2011 13:40:15 -0000 Issue 7270

2011-04-12 Thread php-general-digest-help
php-general Digest 12 Apr 2011 13:40:15 - Issue 7270 Topics (messages 312338 through 312354): Eliminatimg PHP UTF-8 BOM in a returned stream to a Mobile App 312338 by: Eli Orr 312342 by: Richard Quadling 312346 by: Eli Orr 312348 by: Richard Quadling

php-general Digest 13 Apr 2011 02:06:35 -0000 Issue 7271

2011-04-12 Thread php-general-digest-help
php-general Digest 13 Apr 2011 02:06:35 - Issue 7271 Topics (messages 312355 through 312360): Re: a shortcut to set variable 312355 by: David Harkness 312356 by: Richard Quadling Debugging Help Needed 312357 by: Rich Shepard 312358 by: Daniel Brown

[PHP] Eliminatimg PHP UTF-8 BOM in a returned stream to a Mobile App

2011-04-12 Thread Eli Orr
Dear PHP Gurus, I would like to Eliminate the 3 UTF-8 BOM enforced on my returned BLOB: The PHP server adds utf-8 BOM (UTF-8 Byte Order Mark - in the beginning of UTF-8 files) which consists of three bytes: EF BB BF. The Mobile App served by the server Does not need that. How can I

Re: [PHP] Error in variable assignment

2011-04-12 Thread Richard Quadling
On 11 April 2011 20:28, Ethan Rosenberg eth...@earthlink.net wrote: Dear list - I an writing a script that will simulate a chess board.  On a move from e2 to e6 [see below] the variable in e2 is never assigned to e6.  Here are some code snippets: ?php session_start(); session_name(Chess);

[PHP] a shortcut to set variable

2011-04-12 Thread Joe Francis
eh, I just want to get a shortcut like $id = isset($_GET['id']) ? $_GET['id'] : 0; BTW, I'm using PHP5.3+, thanks bros. -- Powered By Francis™. Welcome to my website: http://www.francistm.com Rewrite to francis...@gmail.com please.

[PHP] Re: a shortcut to set variable

2011-04-12 Thread David Robley
Joe Francis wrote: eh, I just want to get a shortcut like $id = isset($_GET['id']) ? $_GET['id'] : 0; BTW, I'm using PHP5.3+, thanks bros. That should work - what is not happening that you expect to happen, or the other way round? Cheers -- David Robley The best way to keep

Re: [PHP] Eliminatimg PHP UTF-8 BOM in a returned stream to a Mobile App

2011-04-12 Thread Richard Quadling
2011/4/12 Eli Orr eli@logodial.com: Dear PHP Gurus, I would like to Eliminate the 3 UTF-8 BOM enforced on my returned BLOB: The PHP server adds  utf-8 BOM (UTF-8 Byte Order Mark  - in the beginning of UTF-8  files) which consists of three bytes: EF BB BF. The Mobile App served by the

Re: [PHP] a shortcut to set variable

2011-04-12 Thread tedd
At 11:06 AM +0100 4/12/11, Stuart Dallas wrote: On Tuesday, 12 April 2011 at 10:36, Joe Francis wrote: eh, I just want to get a shortcut like $id = isset($_GET['id']) ? $_GET['id'] : 0; BTW, I'm using PHP5.3+, thanks bros. http://stut.net/2011/04/12/php-snippet-array-element-access/

Re: [PHP] a shortcut to set variable

2011-04-12 Thread Stuart Dallas
On Tuesday, 12 April 2011 at 11:52, tedd wrote: At 11:06 AM +0100 4/12/11, Stuart Dallas wrote: On Tuesday, 12 April 2011 at 10:36, Joe Francis wrote: eh, I just want to get a shortcut like $id = isset($_GET['id']) ? $_GET['id'] : 0; BTW, I'm using PHP5.3+, thanks bros.

RE: [PHP] Eliminatimg PHP UTF-8 BOM in a returned stream to a Mobile App

2011-04-12 Thread Eli Orr
Hi Richard, Thanks. Indeed, that is the case - I've included a code that has UTF-8 string contants -so I guess the PHP parser set the UTF-8 mode to ON so that the returned string to the client has the UTF-8 BOM. It is not a big issue as the mobile app guys aware of this and make the proper

Re: [PHP] a shortcut to set variable

2011-04-12 Thread Richard Quadling
On 12 April 2011 11:57, Stuart Dallas stu...@3ft9.com wrote: On Tuesday, 12 April 2011 at 11:52, tedd wrote: At 11:06 AM +0100 4/12/11, Stuart Dallas wrote: On Tuesday, 12 April 2011 at 10:36, Joe Francis wrote: eh, I just want to get a shortcut like  $id = isset($_GET['id']) ?

Re: [PHP] Eliminatimg PHP UTF-8 BOM in a returned stream to a Mobile App

2011-04-12 Thread Richard Quadling
On 12 April 2011 11:59, Eli Orr eli@logodial.com wrote: Hi Richard, Thanks. Indeed, that is the case - I've included a code that has UTF-8 string contants -so I guess the PHP parser set the UTF-8 mode to ON so that the returned string to the client has the UTF-8 BOM. It is not a

Re: [PHP] Eliminatimg PHP UTF-8 BOM in a returned stream to a Mobile App

2011-04-12 Thread Richard Quadling
On 12 April 2011 12:50, Richard Quadling rquadl...@gmail.com wrote: On 12 April 2011 11:59, Eli Orr eli@logodial.com wrote: Hi Richard, Thanks. Indeed, that is the case - I've included a code that has UTF-8 string contants -so I guess the PHP parser set the UTF-8 mode to ON so that

RE: [PHP] Eliminatimg PHP UTF-8 BOM in a returned stream to a Mobile App

2011-04-12 Thread Eli Orr
Thanks Richard, Do you know a technique to mirror all the echo strings into a file for debugging ? Eli -Original Message- From: Richard Quadling [mailto:rquadl...@gmail.com] Sent: Tuesday, April 12, 2011 2:51 PM To: Eli Orr Cc: php-general@lists.php.net Subject: Re: [PHP]

RE: [PHP] Eliminatimg PHP UTF-8 BOM in a returned stream to a Mobile App

2011-04-12 Thread Eli Orr
Hi Richard, Thanks. I've already got a solution to simply use Notes++ and save the PHP script with Save As encoding set to ANSI (It was UTF-8 indeed that creates the BOM...). Thanks again Eli -Original Message- From: Richard Quadling [mailto:rquadl...@gmail.com] Sent: Tuesday,

Re: [PHP] a shortcut to set variable

2011-04-12 Thread tedd
At 12:47 PM +0100 4/12/11, Richard Quadling wrote: Putting () around ternary's is a best practise. ?php echo 'Are we ready to go? ', isset($go) ? 'Yes we are.' : 'No we are not.', ' Ready state completed', PHP_EOL; $go = true; echo 'Are we ready to go? ', isset($go) ? 'Yes we are.' : 'No we are

Re: [PHP] Eliminatimg PHP UTF-8 BOM in a returned stream to a Mobile App

2011-04-12 Thread Richard Quadling
On 12 April 2011 13:29, Eli Orr eli@logodial.com wrote: Hi Richard, Thanks. I've already got a solution to simply use Notes++ and save the PHP script with Save As encoding set to ANSI (It was UTF-8 indeed that creates the BOM...). Thanks again Eli -Original Message- From:

Re: [PHP] a shortcut to set variable

2011-04-12 Thread Richard Quadling
On 12 April 2011 14:25, tedd tedd.sperl...@gmail.com wrote: At 12:47 PM +0100 4/12/11, Richard Quadling wrote: Putting () around ternary's is a best practise. ?php echo 'Are we ready to go? ', isset($go) ? 'Yes we are.' : 'No we are not.', ' Ready state completed', PHP_EOL; $go = true;

Re: [PHP] a shortcut to set variable

2011-04-12 Thread David Harkness
On Tue, Apr 12, 2011 at 6:34 AM, Richard Quadling rquadl...@gmail.comwrote: Without running the code, can you say what the output will be in the 3 examples? Yes, but I would still rewrite that code. ;) I typically reserve the ternary operator to return a value or assign a variable. Given that

Re: [PHP] a shortcut to set variable

2011-04-12 Thread Richard Quadling
On 12 April 2011 20:00, David Harkness davi...@highgearmedia.com wrote: On Tue, Apr 12, 2011 at 6:34 AM, Richard Quadling rquadl...@gmail.com wrote: Without running the code, can you say what the output will be in the 3 examples? Yes, but I would still rewrite that code. ;) I typically

[PHP] Debugging Help Needed

2011-04-12 Thread Rich Shepard
I'm not a PHP coder, but I have an application written in PHP (CMS Made Simple) that stopped working when I upgraded postgres to 9.x. I seem to have most of the problems fixed (those with adodb_lite) but now need to track down why I get a 404 Page Not Found error when I try to invoke the local

Re: [PHP] Debugging Help Needed

2011-04-12 Thread Daniel Brown
On Tue, Apr 12, 2011 at 18:29, Rich Shepard rshep...@appl-ecosys.com wrote:  Looking at the PHP manual I see there's a function called debug_print_backtrace(), but I have not found how to properly use it. When I insert it at the top of ErrorHandler404(), php throws an error when I try to run

Re: [PHP] Debugging Help Needed

2011-04-12 Thread Rich Shepard
On Tue, 12 Apr 2011, Daniel Brown wrote: You missed the ending semicolon, that's all. Daniel, Oops! Too long since C and Python doesn't use semicolons. Adding that, I remove the error but do not see the printed backtrace. Please suggest how I can determine the source of the page not

Re: [PHP] Debugging Help Needed

2011-04-12 Thread Paul M Foster
On Tue, Apr 12, 2011 at 03:37:26PM -0700, Rich Shepard wrote: On Tue, 12 Apr 2011, Daniel Brown wrote: You missed the ending semicolon, that's all. Daniel, Oops! Too long since C and Python doesn't use semicolons. Wait, what?! Did they change C? When did this happen?! ;-} Paul