php-general Digest 26 Mar 2009 13:01:07 -0000 Issue 6033

Topics (messages 290688 through 290698):

Re: A fatal error with php virtual cron
        290688 by: אלמוג בקו
        290690 by: Igor Escobar
        290691 by: Shawn McKenzie
        290692 by: אלמוג בקו
        290693 by: Shawn McKenzie
        290694 by: אלמוג בקו

Re: Namespce operator
        290689 by: Eric Butera
        290696 by: Nathan Rixham

Re: newbe question
        290695 by: Raymond Irving

Re: Problems with implode
        290697 by: Toke Herkild
        290698 by: Virgilio Quilario

Administrivia:

To subscribe to the digest, e-mail:
        [email protected]

To unsubscribe from the digest, e-mail:
        [email protected]

To post to the list, e-mail:
        [email protected]


----------------------------------------------------------------------
--- Begin Message ---
I already wrote that..

ignore_user_abort(true);
set_time_limit(0);
sleep(1);

________________


*
          צור איתי קשר:*  <http://www.facebook.com/profile.php?id=682327963>


On Wed, Mar 25, 2009 at 9:38 PM, Igor Escobar <[email protected]> wrote:

> Try the ignore_user_abort(true);
>
> Regards,
> Igor Escobar
> systems analyst & interface designer
> www . igorescobar . com
>
>
>
> On Wed, Mar 25, 2009 at 4:21 PM, אלמוג בקו <[email protected]> wrote:
>
>> This is a part of the class:
>>
>> private function _request() {
>>     //URL information
>>     $url        = "http://".$_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];
>>     $url_info    = parse_url($url);
>>
>>     //Fixing port
>>     if(!isset($url_info['port'])) $url_info['port']=80;
>>
>>
>>     //Send "Cron-data"
>>     $data = array(
>>         'jobs'        => base64_encode(var_export($this->jobs, true)),
>>         'firstRun'    => base64_encode($this->firstRun)
>>     );
>>     $data=http_build_query($data);
>>
>>     //Headers
>>     $headers = ""
>>                 ."POST " . $url . " HTTP/1.0 \r\n"
>>                 ."HOST: " . $url_info['host'] . ":" . $url_info['port'] .
>> " \r\n"
>>                 ."Content-type: application/x-www-form-urlencoded \r\n"
>>                 ."Content-Length: " . strlen($data) . " \r\n"
>>                 ."User-Agent: phpCron \r\n"
>>                 ."Connection: close\r\n\r\n"
>>                 .$data
>>                 ;
>>
>>     //Error vars
>>     $errstr    = null;
>>     $errno     = null;
>>
>>     $fp = fsockopen($_SERVER['HTTP_HOST'], $_SERVER['SERVER_PORT'],
>> $errno, $errstr, 0.5);
>>     if($fp) {
>>         @fwrite($fp, $headers);
>>         @stream_set_timeout($fp, 0.5);
>>         @stream_set_blocking($fp, 0);
>>         @fclose($fp);
>>         return true;
>>     } else {
>>         $this->error = array('socket'=>array('errstr'=>$errstr,
>> 'errno'=>$errno));
>>         return false;
>>     }
>> }
>>
>> ________________
>>
>>
>> *
>>           צור איתי קשר:*
>> <http://www.facebook.com/profile.php?id=682327963>
>>
>>
>> On Wed, Mar 25, 2009 at 9:17 PM, Igor Escobar <[email protected]>wrote:
>>
>>> Maybe your problem are in the way you're calling your program by socket.
>>>
>>> If you show me this part of the code, maybe i can help you.
>>>
>>> Regards,
>>>
>>> Igor Escobar
>>> systems analyst & interface designer
>>> www . igorescobar . com
>>>
>>>
>>>
>>> On Wed, Mar 25, 2009 at 4:01 PM, אלמוג בקו <[email protected]> wrote:
>>>
>>>> Hello,
>>>> There is some week than I trying to solve a critical error on my
>>>> VirtualCron
>>>> script.
>>>>
>>>> *First of all what is VirtualCron?:*
>>>> Virtual cron is script that`s call(http request) himself and doing the
>>>> "jobs" by the time(like a cron-jobs on linux, but this script build on
>>>> php
>>>> and its make it independent by the Operation System and the access to
>>>> the
>>>> server. [wordpress build something like that too]).
>>>>
>>>> *How my system works?:*
>>>> I have a page(cron.php) and I set this settings:
>>>>
>>>>  ignore_user_abort(true);
>>>>  set_time_limit(0);
>>>>  sleep(1); //setting the base time unit
>>>>
>>>> I call to the script by socket connection with timout of 0.5s and with
>>>> non-blocking mode.
>>>>
>>>> Additionaly I have a log system that save a file with the error when
>>>> they
>>>> happend. andI can "kill" the script by deleting "pid" file.
>>>>
>>>> *Well what`s happend?:*
>>>> The script works well when I tune a job to work more 5min from the
>>>> running
>>>> time.
>>>> But from some reason the script stop to run after some seconds.. and the
>>>> system`s log dosent show any php`s error.
>>>>
>>>> BUT I found this error on my apache`s logs:
>>>> *[Wed Mar 25 10:25:19 2009] [error] [client 67.205.44.109] Premature end
>>>> of
>>>> script headers: cron.php*
>>>>
>>>>
>>>> I hope thats someone know what I have to do..
>>>> Thanks a lot,
>>>> Almog Baku, Israel.
>>>>
>>>> *
>>>> *** My script run on Shared DreamHost, with php5 & apache on linux ***
>>>> *
>>>> ________________
>>>>
>>>>
>>>> *
>>>>          צור איתי קשר:*  <
>>>> http://www.facebook.com/profile.php?id=682327963>
>>>>
>>>
>>>
>>
>

--- End Message ---
--- Begin Message ---
Oh, Sorry, I had not seen.

Well, I don't see anything wrong in your code, but maybe...if you find in
your apache config file, you can found for something similar to your problem
...

Sorry can't help you.


Regards,
Igor Escobar
systems analyst & interface designer
www . igorescobar . com



On Wed, Mar 25, 2009 at 4:40 PM, אלמוג בקו <[email protected]> wrote:

> I already wrote that..
>
> ignore_user_abort(true);
> set_time_limit(0);
> sleep(1);
>
> ________________
>
>
> *
>           צור איתי קשר:*
> <http://www.facebook.com/profile.php?id=682327963>
>
>
> On Wed, Mar 25, 2009 at 9:38 PM, Igor Escobar <[email protected]>wrote:
>
>> Try the ignore_user_abort(true);
>>
>> Regards,
>> Igor Escobar
>> systems analyst & interface designer
>> www . igorescobar . com
>>
>>
>>
>> On Wed, Mar 25, 2009 at 4:21 PM, אלמוג בקו <[email protected]> wrote:
>>
>>> This is a part of the class:
>>>
>>> private function _request() {
>>>     //URL information
>>>     $url        = "http://".$_SERVER['HTTP_HOST'] .
>>> $_SERVER['PHP_SELF'];
>>>     $url_info    = parse_url($url);
>>>
>>>     //Fixing port
>>>     if(!isset($url_info['port'])) $url_info['port']=80;
>>>
>>>
>>>     //Send "Cron-data"
>>>     $data = array(
>>>         'jobs'        => base64_encode(var_export($this->jobs, true)),
>>>         'firstRun'    => base64_encode($this->firstRun)
>>>     );
>>>     $data=http_build_query($data);
>>>
>>>     //Headers
>>>     $headers = ""
>>>                 ."POST " . $url . " HTTP/1.0 \r\n"
>>>                 ."HOST: " . $url_info['host'] . ":" . $url_info['port'] .
>>> " \r\n"
>>>                 ."Content-type: application/x-www-form-urlencoded \r\n"
>>>                 ."Content-Length: " . strlen($data) . " \r\n"
>>>                 ."User-Agent: phpCron \r\n"
>>>                 ."Connection: close\r\n\r\n"
>>>                 .$data
>>>                 ;
>>>
>>>     //Error vars
>>>     $errstr    = null;
>>>     $errno     = null;
>>>
>>>     $fp = fsockopen($_SERVER['HTTP_HOST'], $_SERVER['SERVER_PORT'],
>>> $errno, $errstr, 0.5);
>>>     if($fp) {
>>>         @fwrite($fp, $headers);
>>>         @stream_set_timeout($fp, 0.5);
>>>         @stream_set_blocking($fp, 0);
>>>         @fclose($fp);
>>>         return true;
>>>     } else {
>>>         $this->error = array('socket'=>array('errstr'=>$errstr,
>>> 'errno'=>$errno));
>>>         return false;
>>>     }
>>> }
>>>
>>> ________________
>>>
>>>
>>> *
>>>           צור איתי קשר:*
>>> <http://www.facebook.com/profile.php?id=682327963>
>>>
>>>
>>> On Wed, Mar 25, 2009 at 9:17 PM, Igor Escobar <[email protected]>wrote:
>>>
>>>> Maybe your problem are in the way you're calling your program by socket.
>>>>
>>>> If you show me this part of the code, maybe i can help you.
>>>>
>>>> Regards,
>>>>
>>>> Igor Escobar
>>>> systems analyst & interface designer
>>>> www . igorescobar . com
>>>>
>>>>
>>>>
>>>> On Wed, Mar 25, 2009 at 4:01 PM, אלמוג בקו <[email protected]>wrote:
>>>>
>>>>> Hello,
>>>>> There is some week than I trying to solve a critical error on my
>>>>> VirtualCron
>>>>> script.
>>>>>
>>>>> *First of all what is VirtualCron?:*
>>>>> Virtual cron is script that`s call(http request) himself and doing the
>>>>> "jobs" by the time(like a cron-jobs on linux, but this script build on
>>>>> php
>>>>> and its make it independent by the Operation System and the access to
>>>>> the
>>>>> server. [wordpress build something like that too]).
>>>>>
>>>>> *How my system works?:*
>>>>> I have a page(cron.php) and I set this settings:
>>>>>
>>>>>  ignore_user_abort(true);
>>>>>  set_time_limit(0);
>>>>>  sleep(1); //setting the base time unit
>>>>>
>>>>> I call to the script by socket connection with timout of 0.5s and with
>>>>> non-blocking mode.
>>>>>
>>>>> Additionaly I have a log system that save a file with the error when
>>>>> they
>>>>> happend. andI can "kill" the script by deleting "pid" file.
>>>>>
>>>>> *Well what`s happend?:*
>>>>> The script works well when I tune a job to work more 5min from the
>>>>> running
>>>>> time.
>>>>> But from some reason the script stop to run after some seconds.. and
>>>>> the
>>>>> system`s log dosent show any php`s error.
>>>>>
>>>>> BUT I found this error on my apache`s logs:
>>>>> *[Wed Mar 25 10:25:19 2009] [error] [client 67.205.44.109] Premature
>>>>> end of
>>>>> script headers: cron.php*
>>>>>
>>>>>
>>>>> I hope thats someone know what I have to do..
>>>>> Thanks a lot,
>>>>> Almog Baku, Israel.
>>>>>
>>>>> *
>>>>> *** My script run on Shared DreamHost, with php5 & apache on linux ***
>>>>> *
>>>>> ________________
>>>>>
>>>>>
>>>>> *
>>>>>          צור איתי קשר:*  <
>>>>> http://www.facebook.com/profile.php?id=682327963>
>>>>>
>>>>
>>>>
>>>
>>
>

--- End Message ---
--- Begin Message ---
אלמוג בקו wrote:
> This is a part of the class:
> 
> private function _request() {
>     //URL information
>     $url        = "http://".$_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];
>     $url_info    = parse_url($url);
> 
>     //Fixing port
>     if(!isset($url_info['port'])) $url_info['port']=80;
> 
> 
>     //Send "Cron-data"
>     $data = array(
>         'jobs'        => base64_encode(var_export($this->jobs, true)),
>         'firstRun'    => base64_encode($this->firstRun)
>     );
>     $data=http_build_query($data);
> 
>     //Headers
>     $headers = ""
>                 ."POST " . $url . " HTTP/1.0 \r\n"
>                 ."HOST: " . $url_info['host'] . ":" . $url_info['port'] . "
> \r\n"
>                 ."Content-type: application/x-www-form-urlencoded \r\n"
>                 ."Content-Length: " . strlen($data) . " \r\n"
>                 ."User-Agent: phpCron \r\n"
>                 ."Connection: close\r\n\r\n"
>                 .$data
>                 ;
> 
>     //Error vars
>     $errstr    = null;
>     $errno     = null;
> 
>     $fp = fsockopen($_SERVER['HTTP_HOST'], $_SERVER['SERVER_PORT'], $errno,
> $errstr, 0.5);
>     if($fp) {
>         @fwrite($fp, $headers);
>         @stream_set_timeout($fp, 0.5);
>         @stream_set_blocking($fp, 0);
>         @fclose($fp);
>         return true;
>     } else {
>         $this->error = array('socket'=>array('errstr'=>$errstr,
> 'errno'=>$errno));
>         return false;
>     }
> }
> 
> ________________
> 
> 
> *
>           צור איתי קשר:*  <http://www.facebook.com/profile.php?id=682327963>
> 
> 
> On Wed, Mar 25, 2009 at 9:17 PM, Igor Escobar <[email protected]> wrote:
> 
>> Maybe your problem are in the way you're calling your program by socket.
>>
>> If you show me this part of the code, maybe i can help you.
>>
>> Regards,
>>
>> Igor Escobar
>> systems analyst & interface designer
>> www . igorescobar . com
>>
>>
>>
>> On Wed, Mar 25, 2009 at 4:01 PM, אלמוג בקו <[email protected]> wrote:
>>
>>> Hello,
>>> There is some week than I trying to solve a critical error on my
>>> VirtualCron
>>> script.
>>>
>>> *First of all what is VirtualCron?:*
>>> Virtual cron is script that`s call(http request) himself and doing the
>>> "jobs" by the time(like a cron-jobs on linux, but this script build on php
>>> and its make it independent by the Operation System and the access to the
>>> server. [wordpress build something like that too]).
>>>
>>> *How my system works?:*
>>> I have a page(cron.php) and I set this settings:
>>>
>>>  ignore_user_abort(true);
>>>  set_time_limit(0);
>>>  sleep(1); //setting the base time unit
>>>
>>> I call to the script by socket connection with timout of 0.5s and with
>>> non-blocking mode.
>>>
>>> Additionaly I have a log system that save a file with the error when they
>>> happend. andI can "kill" the script by deleting "pid" file.
>>>
>>> *Well what`s happend?:*
>>> The script works well when I tune a job to work more 5min from the running
>>> time.
>>> But from some reason the script stop to run after some seconds.. and the
>>> system`s log dosent show any php`s error.
>>>
>>> BUT I found this error on my apache`s logs:
>>> *[Wed Mar 25 10:25:19 2009] [error] [client 67.205.44.109] Premature end
>>> of
>>> script headers: cron.php*
>>>
>>>
>>> I hope thats someone know what I have to do..
>>> Thanks a lot,
>>> Almog Baku, Israel.
>>>
>>> *
>>> *** My script run on Shared DreamHost, with php5 & apache on linux ***
>>> *
>>> ________________
>>>
>>>
>>> *
>>>          צור איתי קשר:*  <
>>> http://www.facebook.com/profile.php?id=682327963>
>>>
>>
> 
What's the code that's receiving this post?  Also, if running PHP under
fastcgi, fastcgi has its own timesettings.


-- 
Thanks!
-Shawn
http://www.spidean.com

--- End Message ---
--- Begin Message ---
my script(cron.php) check the job and call by http-request
himself(cron.php).

I already solve the timezone problem, I set the timezone to Israel`s
timezone[works fine]:

//Set TimeZone
date_default_timezone_set(timezone_name_from_abbr("", 2*60*60, null));

________________


*
          צור איתי קשר:*  <http://www.facebook.com/profile.php?id=682327963>


On Wed, Mar 25, 2009 at 10:22 PM, Shawn McKenzie <[email protected]>wrote:

> אלמוג בקו wrote:
> > This is a part of the class:
> >
> > private function _request() {
> >     //URL information
> >     $url        = "http://".$_SERVER['HTTP_HOST'] .
> $_SERVER['PHP_SELF'];
> >     $url_info    = parse_url($url);
> >
> >     //Fixing port
> >     if(!isset($url_info['port'])) $url_info['port']=80;
> >
> >
> >     //Send "Cron-data"
> >     $data = array(
> >         'jobs'        => base64_encode(var_export($this->jobs, true)),
> >         'firstRun'    => base64_encode($this->firstRun)
> >     );
> >     $data=http_build_query($data);
> >
> >     //Headers
> >     $headers = ""
> >                 ."POST " . $url . " HTTP/1.0 \r\n"
> >                 ."HOST: " . $url_info['host'] . ":" . $url_info['port'] .
> "
> > \r\n"
> >                 ."Content-type: application/x-www-form-urlencoded \r\n"
> >                 ."Content-Length: " . strlen($data) . " \r\n"
> >                 ."User-Agent: phpCron \r\n"
> >                 ."Connection: close\r\n\r\n"
> >                 .$data
> >                 ;
> >
> >     //Error vars
> >     $errstr    = null;
> >     $errno     = null;
> >
> >     $fp = fsockopen($_SERVER['HTTP_HOST'], $_SERVER['SERVER_PORT'],
> $errno,
> > $errstr, 0.5);
> >     if($fp) {
> >         @fwrite($fp, $headers);
> >         @stream_set_timeout($fp, 0.5);
> >         @stream_set_blocking($fp, 0);
> >         @fclose($fp);
> >         return true;
> >     } else {
> >         $this->error = array('socket'=>array('errstr'=>$errstr,
> > 'errno'=>$errno));
> >         return false;
> >     }
> > }
> >
> > ________________
> >
> >
> > *
> >           צור איתי קשר:*  <
> http://www.facebook.com/profile.php?id=682327963>
> >
> >
> > On Wed, Mar 25, 2009 at 9:17 PM, Igor Escobar <[email protected]>
> wrote:
> >
> >> Maybe your problem are in the way you're calling your program by socket.
> >>
> >> If you show me this part of the code, maybe i can help you.
> >>
> >> Regards,
> >>
> >> Igor Escobar
> >> systems analyst & interface designer
> >> www . igorescobar . com
> >>
> >>
> >>
> >> On Wed, Mar 25, 2009 at 4:01 PM, אלמוג בקו <[email protected]>
> wrote:
> >>
> >>> Hello,
> >>> There is some week than I trying to solve a critical error on my
> >>> VirtualCron
> >>> script.
> >>>
> >>> *First of all what is VirtualCron?:*
> >>> Virtual cron is script that`s call(http request) himself and doing the
> >>> "jobs" by the time(like a cron-jobs on linux, but this script build on
> php
> >>> and its make it independent by the Operation System and the access to
> the
> >>> server. [wordpress build something like that too]).
> >>>
> >>> *How my system works?:*
> >>> I have a page(cron.php) and I set this settings:
> >>>
> >>>  ignore_user_abort(true);
> >>>  set_time_limit(0);
> >>>  sleep(1); //setting the base time unit
> >>>
> >>> I call to the script by socket connection with timout of 0.5s and with
> >>> non-blocking mode.
> >>>
> >>> Additionaly I have a log system that save a file with the error when
> they
> >>> happend. andI can "kill" the script by deleting "pid" file.
> >>>
> >>> *Well what`s happend?:*
> >>> The script works well when I tune a job to work more 5min from the
> running
> >>> time.
> >>> But from some reason the script stop to run after some seconds.. and
> the
> >>> system`s log dosent show any php`s error.
> >>>
> >>> BUT I found this error on my apache`s logs:
> >>> *[Wed Mar 25 10:25:19 2009] [error] [client 67.205.44.109] Premature
> end
> >>> of
> >>> script headers: cron.php*
> >>>
> >>>
> >>> I hope thats someone know what I have to do..
> >>> Thanks a lot,
> >>> Almog Baku, Israel.
> >>>
> >>> *
> >>> *** My script run on Shared DreamHost, with php5 & apache on linux ***
> >>> *
> >>> ________________
> >>>
> >>>
> >>> *
> >>>          צור איתי קשר:*  <
> >>> http://www.facebook.com/profile.php?id=682327963>
> >>>
> >>
> >
> What's the code that's receiving this post?  Also, if running PHP under
> fastcgi, fastcgi has its own timesettings.
>
>
> --
> Thanks!
> -Shawn
> http://www.spidean.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
אלמוג בקו wrote:
> my script(cron.php) check the job and call by http-request
> himself(cron.php).
> 
> I already solve the timezone problem, I set the timezone to Israel`s
> timezone[works fine]:
> 
> //Set TimeZone
> date_default_timezone_set(timezone_name_from_abbr("", 2*60*60, null));
> 
 I was talking about timeout settings for scripts in fastcgi.

-- 
Thanks!
-Shawn
http://www.spidean.com

--- End Message ---
--- Begin Message ---
amm.. i don`t really know what is fast-cgi. well I think I don't use it.
however, thanks.

________________


*
          צור איתי קשר:*  <http://www.facebook.com/profile.php?id=682327963>


On Wed, Mar 25, 2009 at 10:33 PM, Shawn McKenzie <[email protected]>wrote:

> אלמוג בקו wrote:
> > my script(cron.php) check the job and call by http-request
> > himself(cron.php).
> >
> > I already solve the timezone problem, I set the timezone to Israel`s
> > timezone[works fine]:
> >
> > //Set TimeZone
> > date_default_timezone_set(timezone_name_from_abbr("", 2*60*60, null));
> >
>  I was talking about timeout settings for scripts in fastcgi.
>
> --
> Thanks!
> -Shawn
> http://www.spidean.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
On Wed, Mar 25, 2009 at 8:30 AM, Jochem Maas <[email protected]> wrote:
> Christoph Boget schreef:
>>>> Backslash? Seriously? I'm hurt that my suggestion of "¬" (ASCII170 ?)
>>>> wasn't used. :-(
>>> Backslash doesn't sound like it will look very pretty
>>
>> Windows and DOS have been getting away with it for the last 25+ years
>> so why can't PHP get in on that action? :P
>>
>> Though I have read the explanation (many, many times) and I still
>> don't understand why '::' wasn't used.  MyClass::MyStaticMethod is
>> utilizing namespacing.
>
> it's a serious brain hemoraging affair, I had the honour of digging quite
> deep into this with Greg Beaver ... he proved beyond a shadow of a doubt that
> there we're serious issues ... and trust me he really delved deep into the 
> problem
> (and he's way smarter than *most*)
>
> we're lucky he put in the work.
>
>> Why it was felt that '::' as the official
>> namespace operator would mess that up is beyond my ken. :(
>>
>> thnx,
>> Christoph
>>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

I think you fell for the bait. :)


-- 
http://www.voom.me | EFnet: #voom

--- End Message ---
--- Begin Message ---
Jochem Maas wrote:
Luke schreef:
Backslash doesn't sound like it will look very pretty

2009/3/25 Richard Heyes <[email protected]>

Backslash? Seriously? I'm hurt that my suggestion of "¬" (ASCII170 ?)
wasn't used. :-(

please kill this thread, the namespace operator was heavily discussed
multiple times in the last 1-2 years on the internals mailing list.

the decision was made a long, long time ago.

yeah dunno what muppet reproposed the \ when ::: looking good lololololololololololol
--- End Message ---
--- Begin Message ---
Hi Andres,

I'm also new to this mailing list.

The echo function does not insert a \n at the end of the line. Try removing the 
extra space after the ?>


__
Raymond Irving
Create Rich PHP Web Apps Today!
Raxan PDI - http://raxanpdi.com/



--- On Wed, 3/25/09, Andres Gonzalez <[email protected]> wrote:

From: Andres Gonzalez <[email protected]>
Subject: [PHP] newbe question
To: [email protected]
Date: Wednesday, March 25, 2009, 11:28 AM

Hi,

I want to learn PHP so I started using it for all of my general purpose 
scripts. The general format of my scripts are like this:

#!/usr/bin/php
<?php

.....bla bla bla  PHP code

?>

When I run my scripts and I have an echo (or print) at the end of the script to 
print out the results of the script, I get an extra line feed printed out. It 
seems that I can use this:

echo " bla bla bla with no terminating line feed";

and I will not get a line feed. But when I use the echo at the end of the 
script I get a terminating line feed. Is this correct or am I misinterpreting 
this?

Does echo and print always terminate the string with a \n ?
The function manual does not seem to mention anything about this.

thanks,

-Andres



-- PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



--- End Message ---
--- Begin Message ---
Tom Worster skrev:
On 3/24/09 9:25 AM, "Andrea Giammarchi" <[email protected]> wrote:

Dunno why you guys started talk about utf-8 problems, he has a list of ids
which should contain only unsigned integers, otherwise I do not get how that
query could work with an implode(',', $whatever) rather than 'id in
("'.implode('","', array_map('mysql_real_escape_string', $whatever)).'")' ...
so, the problem could be more about missed ids in the array obtaining ,, ...
so, in this case, array_filter before, no?

it's certainly possible. but the way toke described his problem did not
imply that his ids were unsigned integers.

SELECT FROM ... WHERE id IN ('aardvark', 'abacus', 'abbey', ..., 'zulu',
'zygote');




AS written else it is not a problem with either implode nor with string,
Only when sending debug info via unformatted mail.
Which really should not give this problem, but it does one day I'll have time to figure out exactly what does trigger this error.

Regards,
Toke

--- End Message ---
--- Begin Message ---
>>> Dunno why you guys started talk about utf-8 problems, he has a list of
>>> ids
>>> which should contain only unsigned integers, otherwise I do not get how
>>> that
>>> query could work with an implode(',', $whatever) rather than 'id in
>>> ("'.implode('","', array_map('mysql_real_escape_string', $whatever)).'")'
>>> ...
>>> so, the problem could be more about missed ids in the array obtaining ,,
>>> ...
>>> so, in this case, array_filter before, no?
>>
>> it's certainly possible. but the way toke described his problem did not
>> imply that his ids were unsigned integers.
>>
>> SELECT FROM ... WHERE id IN ('aardvark', 'abacus', 'abbey', ..., 'zulu',
>> 'zygote');
>>
>>
>>
>
> AS written else it is not a problem with either implode nor with string,
> Only when sending debug info via unformatted mail.
> Which really should not give this problem, but it does one day I'll have
> time to figure out exactly what does trigger this error.
>
> Regards,
> Toke
>

it is probably the way the email message was formatted.
it has to cut long lines to email line length limit.
so you see some numbers are broken ie on different lines.

Virgil
http://www.jampmark.com

--- End Message ---

Reply via email to