Re: [PHP] Orphan functions?

2007-06-01 Thread Marc Weber
On Fri, Jun 01, 2007 at 03:01:48PM -0400, Al wrote: > I gotcha now. I misspoke about writing a tokenizer function, I understood > that it would be a script. > > That's for the suggestion. Though, I was hoping to avoid reinventing > something that already exists. There is another alternative.

Re: [PHP] scheduling a script to check a directory for files

2007-05-30 Thread Marc Weber
> I need to write a script to import '.csv' data files into MySQL. > > My question is how can I have a script execute and check a directory > every 4 hours for any '.csv' files and if it finds any calls a function > to import them? On linux there is cron (you should find many example by googling)

[PHP] stack violation. after last line has been executed succesfully

2007-05-29 Thread Marc Weber
Hello. I've confirmed this problem on my gentoo linux box and using Xampp on windows.. = apache log = [Mon May 28 20:38:47 2007] [notice] child pid 16577 exit signal Aborted (6) *** glibc detected *** /usr/sbin/apache2: free(): invalid n

Re: [PHP] Where would you look for documentation about interface RecursiveIterator? RecursiveIteratorAggregate - suggestion

2007-02-13 Thread Marc Weber
On Tue, Feb 13, 2007 at 11:54:41AM +0100, Marc Weber wrote: > I've implemented a simple walk function which seems to be even easier using php. So consider this thread beeing no longer a problem :) Marc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www

Re: [PHP] Array to Object

2007-02-13 Thread Marc Weber
On Tue, Feb 13, 2007 at 12:02:10PM +0200, Eli wrote: > Hi, > > Having this array: > $arr = array( > 'my var'=>'My Value' > ); > Notice the space in 'my var'. > > Converted to object: > $obj = (object)$arr; > > How can I access $arr['my var'] in $obj ? This works but there ma

[PHP] Where would you look for documentation about interface RecursiveIterator? RecursiveIteratorAggregate - suggestion

2007-02-13 Thread Marc Weber
http://de.php.net/~helly/php/ext/spl/interfaceRecursiveIterator.html This piece of code $array = array(1, 2 => array(21, 22 => array(221, 222), 23 => array(231)), 3); $dir = new RecursiveIteratorIterator(new ArrayIterator($array)); foreach ($dir as $file) { pri

[PHP] static functions and array_map - why not allowed?

2007-02-13 Thread Marc Weber
Why can't I use static functions in array_map? Example: Marc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: Iterators

2007-02-13 Thread Marc Weber
What did I miss here? In case somebody else wants to know. I've found some examples in php sources ( ext/spl/tests/array_009.phpt ) This is the way to accomplish this: $array = array(1, 2 => array(21, 22 => array(221, 222), 23 => array(231)), 3); $dir = new RecursiveIteratorIterator(new Re

Re: [PHP] Iterators - seg faults again

2007-02-12 Thread Marc Weber
On Mon, 12 Feb 2007 20:33:08 +0100, Jochem Maas <[EMAIL PROTECTED]> wrote: how should we know with out seeing the iterator_to_array() definition? iterator_to_array() function is from php. See http://de2.php.net/manual/en/function.iterator-to-array.php Here is another testcase. Why is this

Re: [PHP] round to nearest 500?

2007-02-12 Thread Marc Weber
On Mon, 12 Feb 2007 18:02:41 +0100, <[EMAIL PROTECTED]> wrote: Is there an easy way in php to round to the nearest 500? Yeah $rouned = round($val/500) * 500; Marc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Iterators

2007-02-12 Thread Marc Weber
$a=iterator_to_array(new RecursiveIteratorIterator( A (A(2) , A (3,4), A(5,6; var_dump($a); ?> I'd expect this to output an array containing 2,3,4,5,6. But the result is: array(2) { [0]=> int(5) [1]=> int(6) } What did I miss here? Marc -- PHP General Mailing List (http://www

[PHP] segmentation fault - my fault?

2007-02-12 Thread Marc Weber
Does this script cause a segmentation fault running on your php interpreter, too? = === = === My version: [EMAIL PROTECTED] ~ $ php -v PHP 5.1.6-pl6-gentoo (cli) (bui