Re: [PHP] array_intersect question

2008-12-02 Thread Tim | iHostNZ
I know there must be a more elegant way with array_reduce or something, but I would simply write a function called function array_intersect_m($m_array) { $intersection = $m_array[0]; for ($i=1; $i count($m_array); $i++) { $intersection = array_intersect($m_array[$i], $intersection); }

Re: [PHP] stream_socket_accept() on an SSL socket

2008-12-02 Thread Tim | iHostNZ
When you talk to an SSL server directly with sockets, I believe you need to implement the SSL protocol yourself, which would probably be overkill. There must be a PHP library which does or a native function. You should probably look at this page: http://nz.php.net/manual/en/wrappers.http.php and

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: Browser

[PHP] foreach and destroying variables for memory saving

2008-12-10 Thread Tim | iHostNZ
Hi All, Just to annoy the hell out of you, another thing that has been on my mind for a while: I love the foreach ($ar as $k = $v) { ... } construct and use it all the time. However, I read somewhere that foreach actually uses a copy of $ar instead of the array itself by reference. Wouldn't it

Re: [PHP] Can GD make a JPG thumbnail of a PDF?

2008-12-10 Thread Tim | iHostNZ
On Thu, Dec 11, 2008 at 1:59 PM, Stephen Johnson [EMAIL PROTECTED] wrote: I think you want something like this : exec(convert -density 360x360 -enhance $pdfFile $pdfFile.gif); Yes, that's how i did it here. Didn't find a better solution yet. Was looking at the php module for imagemagick

Re: [PHP] Good PHP book?

2008-12-14 Thread Tim | iHostNZ
The best book is php.net, if you already know a programming language ;-). Otherwise Ashley is probably right. I haven't read any books on php, got all the info off the web, but it's still my main language atm. Tim-Hinnerk Heuer http://www.ihostnz.com On Mon, Dec 15, 2008 at 11:33 AM, jeffery

[PHP] mysql_real_escape_string(asdasddas) ??? wtf

2009-02-20 Thread Tim | iHostNZ
Hi everyone, Can anyone here tell me why mysql_real_escape_string(asdasddas) returns an empty string? Just writing a data import... Anyway, for security but also simply because i might have a ' in the string, i need to escape it. Apparently it is good practice to use mysql_real_escape_string()

Re: [PHP] mysql_real_escape_string(asdasddas) ??? wtf

2009-02-21 Thread Tim | iHostNZ
, 2009-02-21 at 19:19 +1300, Tim | iHostNZ wrote: Hi everyone, Can anyone here tell me why mysql_real_escape_string(asdasddas) returns an empty string? Just writing a data import... Anyway, for security but also simply because i might have a ' in the string, i need to escape

[PHP] catching up

2009-04-16 Thread Tim | iHostNZ
Hey guys, Just trying to catch up to the rest of the world again. Prob wont be able to read all the php mail. Just one thing: Maybe PHP should be renamed to PFP (PHP Free Processor) or something. A recursive acronym sort of suggests that you cannot be free or break out of this infinite loop.