Re: [PHP] in_array() related problem

2006-11-04 Thread Tom Atkinson
Try like this: var_dump(in_array($a, $test, true)); Richard Lynch wrote: Try providing a custom comparison function. Almost for sure, PHP is attempting to test the == by a deeper scan than you think. On Fri, November 3, 2006 10:56 am, tamcy wrote: Hello all, I'm new to this list. To not

[PHP] Re: Is there such a thing?

2006-10-27 Thread Tom Atkinson
http://gtk.php.net/ Integz wrote: http://www.evilbitz.com/2006/10/27/local-php-standalone-binaries-2/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: How do I get ini_set('output_handler', '') to work?!

2006-10-27 Thread Tom Atkinson
You can't test it like that. When you use system('php') you invoke a new instance of php that has the default values. You are apparently already familiar with ini_set() so why not use ini_get() to test if your code works? Daevid Vincent wrote: What am I doing wrong... In my php.ini I have

Re: [PHP] libcurl (cookies across cURL session). . .?

2006-09-23 Thread Tom Atkinson
Use cURL's own cookie handling features. curl_setopt($ch, CURLOPT_COOKIEJAR, '/tmp/cookies.txt'); curl_setopt($ch, CURLOPT_COOKIEFILE, '/tmp/cookies.txt'); That will store the cookies in the file and read them from there next time. /tmp may or may not be a suitable location. Michael Williams

Re: [PHP] Help converting C to PHP

2006-09-22 Thread Tom Atkinson
Martin Alterisio wrote: 2006/9/22, Rory Browne [EMAIL PROTECTED]: On 9/22/06, Kevin Waterson [EMAIL PROTECTED] wrote: This one time, at band camp, Curt Zirzow [EMAIL PROTECTED] wrote: what about using: php.net/pi note the precision description. or are we talking about a

[PHP] Help converting C to PHP

2006-09-21 Thread Tom Atkinson
Hello, I am attempting to convert this code for generating the digits of pi from the original C (below) to PHP. long k=4e3,p,a[337],q,t=1e3; main(j){for(;a[j=q=0]+=2,--k;) for(p=1+2*k;j337;q=a[j]*k+q%p*t,a[j++]=q/p) k!=j2?:printf(%.3d,a[j-2]%t+q/p/t);} I converted this to a more

Re: [PHP] Help converting C to PHP

2006-09-21 Thread Tom Atkinson
Yes, it is. Kevin Waterson wrote: This one time, at band camp, Tom Atkinson [EMAIL PROTECTED] wrote: Hello, I am attempting to convert this code for generating the digits of pi from the original C (below) to PHP. is this for codegolf? Kevin -- PHP General Mailing List (http

Re: [PHP] Help converting C to PHP

2006-09-21 Thread Tom Atkinson
pi() does not give me enough decimal places, I need the first 1000. Curt Zirzow wrote: On 9/21/06, Tom Atkinson [EMAIL PROTECTED] wrote: Hello, I am attempting to convert this code for generating the digits of pi from the original C (below) to PHP. long k=4e3,p,a[337],q,t=1e3; main(j

[PHP] Re: Help converting C to PHP

2006-09-21 Thread Tom Atkinson
I have solved the problem. The variables are declared as and forced to remain integers in C but PHP converts them to float during division. This messed up the maths. Also there was a slight difference in formatting for printf(). Tom Atkinson wrote: Hello, I am attempting to convert

[PHP] Re: FTP Copy

2006-09-19 Thread Tom Atkinson
ftp_rename() should be able do that Matt Palermo wrote: I've been looking on php.net, but can't find anything that covers this... Basically, I am using PHP FTP to connect to an FTP server and run some functions. I want to copy a directory on the FTP server to another directory on the FTP

[PHP] Re: DOMDocument-saveXML()

2006-09-18 Thread Tom Atkinson
Pass the root node of your tree as a parameter to saveXML() Chris Boget wrote: I looked all through the documentation but was unable to find out if this was possible and, if so, how. When you call -saveXML(), it prints out the XML declaration ?xml version=1.0? alont with the structure of the

Re: [PHP] DOMDocument-saveXML()

2006-09-18 Thread Tom Atkinson
Perhaps you missed my reply. http://www.php.net/manual/en/function.dom-domdocument-savexml.php The first parameter to DOMDocument-saveXML() is described: Use this parameter to output only a specific node without XML declaration rather than the entire document. If you pass the root node then

[PHP] Re: Please tell me I dont know regex

2006-09-16 Thread Tom Atkinson
See http://uk.php.net/manual/en/function.eregi.php#57824 Basically you don't need to escape the dash, just place it somewhere where it cannot be interpreted as indicating a range. It will then be treated literally. They do work the same using preg_match() which requires escaping.

[PHP] Re: php and session issues continued...

2006-09-16 Thread Tom Atkinson
How are you setting the location? If the user starts at www.yoursite.com and you redirect to yoursite.com after the first form then you'll lose the session since it's a different domain. Dave Goodchild wrote: Hi all. I have a session issue and wondered if anyone else has encountered this: