[PHP] @session_start()?

2004-04-30 Thread Brandon Goodin
I noticed this notation in one of the PEAR packages @session_start()? What is the purpose of the '@' sign? Thanks Brandon

[PHP] Batch/Prepared statements for Mysql in PHP

2004-04-30 Thread electroteque
I was wondering if there is any current API for creating match/prepare statements, therefore say i have a script to insert, update and insert in the same post, is there a way to reduce to many queries to the database to do it all in one hit ? Although i usually return the last inc id then add it to

Re: [PHP] dollar sign ASCII code

2004-04-30 Thread John W. Holmes
David T-G wrote: I have a comment field where I allow users to enter the picture comments and then I later display them. I thought I was converting everything as needed (I inherited the code), but using a dollar sign breaks things (I'm sure PHP is trying to interpret it). The proper fix, I know,

[PHP] dollar sign ASCII code

2004-04-30 Thread David T-G
Hi, all -- I have a comment field where I allow users to enter the picture comments and then I later display them. I thought I was converting everything as needed (I inherited the code), but using a dollar sign breaks things (I'm sure PHP is trying to interpret it). The proper fix, I know, is to

[PHP] Re: Separating spaces from the rest

2004-04-30 Thread Justin Patrin
Anguz wrote: Thanks! I was just reading that function in the manual when I got your reply. I tested it but I still have a couple of problems with it. print_r(preg_split('(\s+)', " word1 word2 word3.", -1, PREG_SPLIT_DELIM_CAPTURE)); I get this: Array ( [0] => [1] => word1 [2] =>

Re: [PHP] Re: Separating spaces from the rest

2004-04-30 Thread Curt Zirzow
* Thus wrote Anguz ([EMAIL PROTECTED]): > Thanks! I was just reading that function in the manual when I got your > reply. I tested it but I still have a couple of problems with it. > > print_r(preg_split('(\s+)', " word1 word2 word3.", -1, > PREG_SPLIT_DELIM_CAPTURE)); You forgot the pattern

[PHP] Re: Separating spaces from the rest

2004-04-30 Thread Anguz
Thanks! I was just reading that function in the manual when I got your reply. I tested it but I still have a couple of problems with it. print_r(preg_split('(\s+)', " word1 word2 word3.", -1, PREG_SPLIT_DELIM_CAPTURE)); I get this: Array ( [0] => [1] => word1 [2] => word2 [3]

[PHP] Separating spaces from the rest

2004-04-30 Thread Anguz
I have an array with many strings, of which most have spaces or tabs at the beginning, but no fixed number of them. Example: $arr[0] = 'Hello.'; How can I separate them into two strings? Like: Array ( [0] => Array ( [0] => "" //I added the quotes to notice the s

Re: [PHP] initializing HTML form using PHP

2004-04-30 Thread Daniel Clark
That is the way I've done it. I hear that with PEAR, you can add elments to the HTML page. > I have a large HTML form (~100 form elements) that I used a year ago to > conduct a survey. Now I would like to use this same form but rather than > starting with an empty form I would like to populate t

[PHP] initializing HTML form using PHP

2004-04-30 Thread Denis Kertz
I have a large HTML form (~100 form elements) that I used a year ago to conduct a survey. Now I would like to use this same form but rather than starting with an empty form I would like to populate the form with a user's survey response from last year. I have the survey data in a mysql db and I k

Re: [PHP] https & sessions failing to persist

2004-04-30 Thread Curt Zirzow
* Thus wrote Michael R. Wayne ([EMAIL PROTECTED]): > On Fri, Apr 30, 2004 at 08:52:37PM +, Curt Zirzow wrote: > > > > session.cookie_path > > session.cookie_domain > > session.cookie_secure > > session.cookie_path / > session.cookie_secure Off > session.cookie_domain no value > > But we ne

Re: [PHP] https & sessions failing to persist

2004-04-30 Thread Michael R. Wayne
On Fri, Apr 30, 2004 at 08:52:37PM +, Curt Zirzow wrote: > > session.cookie_path > session.cookie_domain > session.cookie_secure session.cookie_path / session.cookie_secure Off session.cookie_domain no value But we never use cookies: session.use_cookies Off /\/\ \/\/ -- PHP Ge

Re: [PHP] https & sessions failing to persist

2004-04-30 Thread Curt Zirzow
* Thus wrote Michael R. Wayne ([EMAIL PROTECTED]): > > Upgraded our PHP installation from 4.1.2 to 4.3.4, scripts that > worked fine before are no longer doing so. The failure can be > traced to the fact that sessions are never being reused (i.e. a new > session gets started with each connection)

[PHP] Re: string replace in files

2004-04-30 Thread Justin Patrin
Steve Buehler wrote: I am trying to write a script that will replace a string in a file. Actually, about 3000 files. And I am stuck. I can get the list of files, but then I pretty much become stuck. I wanted to try str_ireplace (not sure if that is what I should use or not), but I can't ev

Re: [PHP] Register globals off, still not secure?

2004-04-30 Thread Justin Patrin
Patrick Hutchinson wrote: Thanks for the response. I basically have an environment analogous to an internal ISP. A lot of corporate users that have the ability to make web pages for the intranet etc. Basically management wants PHP turned off now because a rogue user could potentially gather and

Re: [PHP] making changes on arrays

2004-04-30 Thread Justin Patrin
Travis Low wrote: Hi Katie, The foreach construct operates on copies of the array values. I usually just stick to C-like syntax: for( $i = 0; $i < count( $array ); $i++ ) { $array[$i] = doSomething( $array[$i] ); } Remember that this will only work for consecutively integer indexed arrays

Re: [PHP] re-keying an array

2004-04-30 Thread Justin Patrin
Richard Harb wrote: Uh, I was wrong... Foreach evaluates only once at initialisation... You can even unset the array once into the loop and it still works perfectly well (not that I recommend this as good practice or whatever, just did some checking to be sure :) Richard That will work because for

Re: [PHP] how to verify PHP has been installed with ldap?

2004-04-30 Thread Evan Nemerson
Are you root when you make install? Follow the directions in Curt's e-mail On Friday 30 April 2004 08:11 am, Bing Du wrote: > Yes, I did. phpinfo() just does not reflect reinstall at all. Here is > the sequence of my operations. > > 1. remove config.cache > 2. ./configure --with-apxs=/usr/local/

Re: [PHP] string replace in files

2004-04-30 Thread John W. Holmes
From: "Steve Buehler" <[EMAIL PROTECTED]> > Thank you so much for this. I was thinking of it all wrong when > doing this. I have a couple of other questions to go along with this. > 1. How would I change this to do a recursive search for the .php files > instead of just the *.php or *

Re: [PHP] Register globals off, still not secure?

2004-04-30 Thread Daniel Clark
Yes. My understanding turning globals off stops using $PHP_AUTH_PW directly. > Hi, Even with register globals off isn't it possible to have a webpage > like this: > > > > > > Hello, > I know your password is > > > > > > > Is there a way to make sure apache doesn't set the $SERVER['PHP_AUT

Re: [PHP] Nonsense mail

2004-04-30 Thread Curt Zirzow
* Thus wrote -{ Rene Brehmer }- ([EMAIL PROTECTED]): > Documented research indicates that on Thu, 29 Apr 2004 11:18:11 -0400, > [EMAIL PROTECTED] wrote about "Re: [PHP] Nonsense mail": > > >On 29 Apr 2004 Brent Clark wrote: > > > >> Could someone please tell me why I keep getting this mail, when I

[PHP] https & sessions failing to persist

2004-04-30 Thread Michael R. Wayne
Upgraded our PHP installation from 4.1.2 to 4.3.4, scripts that worked fine before are no longer doing so. The failure can be traced to the fact that sessions are never being reused (i.e. a new session gets started with each connection). The session files get written with proper information but

Re: [PHP] Installing sendmail in win9X/Me

2004-04-30 Thread Richard Harb
Google: searched for "windows mail server" came up with http://www.pmail.com/ as first link. Incidentially I know this program ... easy to set up and use. hth Friday, April 30, 2004, 7:05:53 PM, thus was written: > Hi, > My english is very poor. > I need install sendmail in windows 9X/Me for

[PHP] Installing sendmail in win9X/Me

2004-04-30 Thread Kemper, Helmut
Hi, My english is very poor. I need install sendmail in windows 9X/Me for use mail() command. PHP work only in localhost which active site server (similar to apache) and send mail by proxy network. Please, help. Thanks, Kemper -

[PHP] PHP, MySQL and Foreign Keys - relations()

2004-04-30 Thread Richard A. DeVenezia
Here is a helpful function for making sense of - foreign keys: which columns of this table refer to primary key of another table - referential: which tables columns refer to the primary key of this table Presumes you are running MySQL with innodb tables. Tested with MySQL 4.1.1-alpha. function r

Re: [PHP] string replace in files

2004-04-30 Thread Steve Buehler
At 11:27 AM 4/30/2004, John W. Holmes wrote: From: "Steve Buehler" <[EMAIL PROTECTED]> > #!/usr/bin/php > $strtoreplace="require \"http://www.domain.com/";; > $replacewithstring="require \"/home/domain/www/"; > > replacestring(); > > function replacestring(){ > GLOBAL $strtoreplace,$replacewithst

Re: [PHP] creating a mailing list

2004-04-30 Thread -{ Rene Brehmer }-
Documented research indicates that on Thu, 29 Apr 2004 15:49:41 +0530, Vinod Panicker wrote about "Re: [PHP] creating a mailing list": >Chris, >Mass mailing is ideally done using mailing lists - in this case i >assume that you would want to frequently send updates to the ppl who >have signed up. >

Re: [PHP] Nonsense mail

2004-04-30 Thread -{ Rene Brehmer }-
Documented research indicates that on Thu, 29 Apr 2004 11:18:11 -0400, [EMAIL PROTECTED] wrote about "Re: [PHP] Nonsense mail": >On 29 Apr 2004 Brent Clark wrote: > >> Could someone please tell me why I keep getting this mail, when I send >> something to the list > >It's an autoresponder on an ema

Re: [PHP] PHP and AS/400

2004-04-30 Thread Travis Low
Hi William, http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=connect+from+PHP+%28in+a+linux+box%29+to+an+AS%2F400+database&btnG=Google+Search All I did was paste your phrase "connect from PHP (in a linux box) to an AS/400 database" into a Google search. Many hits were returned. To answer

Re: [PHP] string replace in files

2004-04-30 Thread John W. Holmes
From: "Steve Buehler" <[EMAIL PROTECTED]> > I am trying to write a script that will replace a string in a > file. Actually, about 3000 files. And I am stuck. I can get the list of > files, but then I pretty much become stuck. I wanted to try str_ireplace > (not sure if that is what I should us

Re: [PHP] Register globals off, still not secure?

2004-04-30 Thread Patrick Hutchinson
Thanks for the response. I basically have an environment analogous to an internal ISP. A lot of corporate users that have the ability to make web pages for the intranet etc. Basically management wants PHP turned off now because a rogue user could potentially gather and store people's passwords

Re: [PHP] Control structure - easier way than repeating conditions in IF?

2004-04-30 Thread Neil Freeman
Why not just use a switch?... switch ($x) { case $a: case $b: case $c: case $d: //do whatever you need break; default: //catch any other values here break; } Neil BOOT wrote: **

Re: [PHP] Register globals off, still not secure?

2004-04-30 Thread Richard Harb
Friday, April 30, 2004, 5:37:15 PM, thus was written: > Hi, Even with register globals off isn't it possible to have a webpage > like this: Not sure what you are asking. You can have a webpage like this. And I guess it even does what it should - print the information. > > > > Hello, > I know

[PHP] string replace in files

2004-04-30 Thread Steve Buehler
I am trying to write a script that will replace a string in a file. Actually, about 3000 files. And I am stuck. I can get the list of files, but then I pretty much become stuck. I wanted to try str_ireplace (not sure if that is what I should use or not), but I can't even get far enough to d

RE: [PHP] PHP and AS/400

2004-04-30 Thread William Lovaton
El vie, 30-04-2004 a las 10:42, Jay Blanchard escribió: > [snip] > So, is this possible? is this a viable solution for a production system? > [/snip] > > Did you even read this article posted by Travis earlier? > http://publib-b.boulder.ibm.com/Redbooks.nsf/RedpieceAbstracts/redp3639. > html Yes,

RE: [PHP] Control structure - easier way than repeating conditions in IF?

2004-04-30 Thread Gryffyn, Trevor
You could do something like this: $valuesarr = array($a,$b,$c,$d); If (in_array($x,$valuesarr)) { # do something } Or I guess even: If (in_array($x,array($a,$b,$c,$d))) { # do something } I don't know if your method or this method have better performance but it's a little eas

[PHP] Control structure - easier way than repeating conditions in IF?

2004-04-30 Thread BOOT
Hello! Can anyone tell me if there is an easier/shorthand for: if (($x == $a) || ($x == $b) || ($x == $c) || ($x == $d) ... ) {;} I understand the logic of why the following does not work: if ($x == ($a || $b || $c || $d)) {;} Thanks! -- PHP General Mailing List (http://www.ph

RE: [PHP] PHP and AS/400

2004-04-30 Thread Jay Blanchard
[snip] So, is this possible? is this a viable solution for a production system? [/snip] Did you even read this article posted by Travis earlier? http://publib-b.boulder.ibm.com/Redbooks.nsf/RedpieceAbstracts/redp3639. html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: h

RE: [PHP] PHP and AS/400

2004-04-30 Thread William Lovaton
El vie, 30-04-2004 a las 10:24, Jay Blanchard escribió: > [snip] > > [snip] > > Is there a way to integrate PHP with AS/400?? > > [/snip] > I do have experience with AS/400. So, is this possible? is this a viable solution for a production system? -- PHP General Mailing List (http://www.php.net/

[PHP] Register globals off, still not secure?

2004-04-30 Thread Patrick Hutchinson
Hi, Even with register globals off isn't it possible to have a webpage like this: Hello, I know your password is Is there a way to make sure apache doesn't set the $SERVER['PHP_AUTH_PW '] global? Thanks. -- /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ Pa

RE: [PHP] PHP and AS/400

2004-04-30 Thread Jay Blanchard
[snip] > [snip] > Is there a way to integrate PHP with AS/400?? > [/snip] > > Probably. http://catb.org/~esr/faqs/smart-questions.html I just hoped that someone could actually answer me. Someone that have experience with AS/400. [/snip] I did actually answer you. I do have experience with AS/4

RE: [PHP] PHP and AS/400

2004-04-30 Thread William Lovaton
El vie, 30-04-2004 a las 08:12, Jay Blanchard escribió: > [snip] > Is there a way to integrate PHP with AS/400?? > [/snip] > > Probably. http://catb.org/~esr/faqs/smart-questions.html I just hoped that someone could actually answer me. Someone that have experience with AS/400. -William -- PH

Re: [PHP] how to verify PHP has been installed with ldap?

2004-04-30 Thread Bing Du
Yes, I did. phpinfo() just does not reflect reinstall at all. Here is the sequence of my operations. 1. remove config.cache 2. ./configure --with-apxs=/usr/local/apache/bin/apxs --with-config-file-path=/usr/local/apache --with-mysql --with-zlib --with-ldap 3. make 4. make install 5. /usr/local/a

Re: [PHP] Create Password for EXISTING PDF FILE

2004-04-30 Thread PHP4Web
My country do not support news:// I can not do that Are you sure there are no way to do that with php - Original Message - From: "Evan Nemerson" <[EMAIL PROTECTED]> To: "PHP4Web" <[EMAIL PROTECTED]> Sent: Friday, April 30, 2004 7:28 AM Subject: Re: [PHP] Create Password for EXISTING PDF FI

RE: [PHP] passing the file back

2004-04-30 Thread rich
> Hi all > In the CMS package mambo , there is an option to backup a database etc. > Which I can do etc, but what I would like to know, is of a way to pass the > .sql file, or what ever was selected, to be passed back to the user > > Im looking in the source, but my OO skills is very much lagging.

Re: [PHP] PHP & Apache Version

2004-04-30 Thread Richard Harb
Friday, April 30, 2004, 3:21:41 PM, thus was written: > Is there a version of Apache 2+ that now works with PHP? Yes there is. Works without problems. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] PHP & Apache Version

2004-04-30 Thread Mike R
Is there a version of Apache 2+ that now works with PHP? Last I checked, the were incompatible, but recently someone I ran into claimed that the bugs have been for such a setup. :) Thanks, -MIke -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub

Re: [PHP] PHP and AS/400

2004-04-30 Thread Travis Low
Wow, what a concept. I found this link by searching the PHP site for "AS/400": http://publib-b.boulder.ibm.com/Redbooks.nsf/RedpieceAbstracts/redp3639.html cheers, Travis William Lovaton wrote: Hi, Is there a way to integrate PHP with AS/400?? -William -- Travis Low

RE: [PHP] PHP and AS/400

2004-04-30 Thread Jay Blanchard
[snip] Is there a way to integrate PHP with AS/400?? [/snip] Probably. http://catb.org/~esr/faqs/smart-questions.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] PHP and AS/400

2004-04-30 Thread William Lovaton
Hi, Is there a way to integrate PHP with AS/400?? -William -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] Asking for data during a script

2004-04-30 Thread Jay Blanchard
[snip] ...stuff... [/snip] Since the HTTP is "stateless" and PHP is server-side gathering data during the execution of a script is virtually impossible. However you can maintain information using cookies or sessions to achieve what you are looking to do. -- PHP General Mailing List (http://www

[PHP] passing the file back

2004-04-30 Thread Brent Clark
Hi all In the CMS package mambo , there is an option to backup a database etc. Which I can do etc, but what I would like to know, is of a way to pass the .sql file, or what ever was selected, to be passed back to the user Im looking in the source, but my OO skills is very much lagging. I basically

[PHP] Hope this helps someone

2004-04-30 Thread Brent Clark
http://www.hk8.org/old_web/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] unexpected array_diff output

2004-04-30 Thread Frederic Noyer
On 30 avr. 04, at 12:11, Ford, Mike [LSS] wrote: On 30 April 2004 09:47, Frederic Noyer wrote: Hello there ! I am trying to fill and then compare two arrays: one filled by a foreach construct, and the second by a while construct. I check both with a print_r to be sure that both are correc

Re: [PHP] Require_once return value on error?

2004-04-30 Thread Stuart
Vincent DUPONT wrote: I need to load various php files programatically and I use require_once($file_path) for this purpose. My question is : is there a way to know if the file was found or not? if the file generated an error or not? RTFM: http://php.net/include "require() and include() are ident

[PHP] Require_once return value on error?

2004-04-30 Thread Vincent DUPONT
Hello, I need to load various php files programatically and I use require_once($file_path) for this purpose. My question is : is there a way to know if the file was found or not? if the file generated an error or not? thank you vincent -- PHP General Mailing List (http://www.php.net/) To unsub

RE: [PHP] unexpected array_diff output

2004-04-30 Thread Ford, Mike [LSS]
On 30 April 2004 09:47, Frederic Noyer wrote: > Hello there ! > I am trying to fill and then compare two arrays: one > filled by a > foreach construct, and the second by a while construct. > I check both with a print_r to be sure that both are correctly filled > (which seems to be the case).

Re: [PHP] Re: unexpected array_diff output

2004-04-30 Thread Torsten Roehr
"Frederic Noyer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > On 30 avr. 04, at 11:31, Torsten Roehr wrote: > > > "Frederic Noyer" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > >> > >> On 30 avr. 04, at 11:00, Torsten Roehr wrote: > > >>> > >>> I think th

Re: [PHP] Re: unexpected array_diff output

2004-04-30 Thread Frederic Noyer
On 30 avr. 04, at 11:31, Torsten Roehr wrote: "Frederic Noyer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] On 30 avr. 04, at 11:00, Torsten Roehr wrote: I think this is correct because the 3 key/value pairs from the first array are NOT in the second one. I think the combination of

Re: [PHP] Re: unexpected array_diff output

2004-04-30 Thread Torsten Roehr
"Frederic Noyer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > On 30 avr. 04, at 11:00, Torsten Roehr wrote: > >> > > > > I think this is correct because the 3 key/value pairs from the first > > array > > are NOT in the second one. I think the combination of key and value are > >

Re: [PHP] Re: unexpected array_diff output

2004-04-30 Thread Frederic Noyer
On 30 avr. 04, at 11:00, Torsten Roehr wrote: I think this is correct because the 3 key/value pairs from the first array are NOT in the second one. I think the combination of key and value are relevant for array_diff(). As I have understand only the array_diff_assoc function does that. see php.ne

Re: [PHP] Re: unexpected array_diff output

2004-04-30 Thread Frederic Noyer
On 30 avr. 04, at 11:00, Torsten Roehr wrote: "Frederic Noyer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Hello there ! I am trying to fill and then compare two arrays: one filled by a foreach construct, and the second by a while construct. I check both with a print_r to be sure t

[PHP] Asking for data during a script

2004-04-30 Thread "Germán M. Rivera"
Hi all! Let's say I have a PHP script that needs the user to input some data during its execution. At the point the data is needed the browser could be redirected to a new page with a form where the user could enter the data. But thus is necessary to save the script state in order to contin

[PHP] Re: unexpected array_diff output

2004-04-30 Thread Torsten Roehr
"Frederic Noyer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hello there ! > I am trying to fill and then compare two arrays: one filled by a > foreach construct, and the second by a while construct. > I check both with a print_r to be sure that both are correctly filled > (which

Re: [PHP] re-keying an array

2004-04-30 Thread Richard Harb
Uh, I was wrong... Foreach evaluates only once at initialisation... You can even unset the array once into the loop and it still works perfectly well (not that I recommend this as good practice or whatever, just did some checking to be sure :) Richard Friday, April 30, 2004, 9:55:14 AM, thus wa

[PHP] Instantiate .NET Classes in PHP5?

2004-04-30 Thread Matthias HALDIMANN
PHP 5 should allow you to instantiante .net classes. However, I can't get the classic example Push(".Net"); $stack->Push("Hello "); echo $stack->Pop() . $stack->Pop(); ?> to work. It gives a "Failed to instantiate .Net object" error, although the .NET framework is installed. Does anyone have

[PHP] unexpected array_diff output

2004-04-30 Thread Frederic Noyer
Hello there ! I am trying to fill and then compare two arrays: one filled by a foreach construct, and the second by a while construct. I check both with a print_r to be sure that both are correctly filled (which seems to be the case). But then, when I try to compare them with a array_diff , the

[PHP] Re: popup windows & variables

2004-04-30 Thread Torsten Roehr
"William Stokes" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hello > > I need to open a popup window from my php page . The information displayed > on this popup depends on a variable value on the first page. How do I > paste/move the variable value to the popup window. The popup

Re: [PHP] Re: Single quotes inside double quoted string (Was: Re: [PHP] Re: Problem with a class... any help will be appreciated.)

2004-04-30 Thread Marius Dascalu
Mr. Holmes is right, sorry for the error. --- "Elliot J. Balanza" <[EMAIL PROTECTED]> wrote: > Actually you are right the problem is not in the > proccess of writing to the > database, the problem is that after writing to the > database it wont "jump" > to the next function it wont go to login()

[PHP] popup windows & variables

2004-04-30 Thread William Stokes
Hello I need to open a popup window from my php page . The information displayed on this popup depends on a variable value on the first page. How do I paste/move the variable value to the popup window. The popup is opened via javascript. I have no idea how to do this. Hope someone can help. Thaks

Re: [PHP] re-keying an array

2004-04-30 Thread Curt Zirzow
* Thus wrote Mattias Thorslund ([EMAIL PROTECTED]): > Just a quick follow-up question on that: > > Curt Zirzow wrote: > > >foreach(array_slice($filenames, 0, 2) as $filename) { > > $files[] = "path/to/" . $filelname; > >} > > > > > > Will a function (such as the array_slice here) in a foreach s

Re: [PHP] re-keying an array

2004-04-30 Thread Richard Harb
Yes and no (in this case). Yes, it'll be evaluated in each iteration and no, I don't think you'd gain that much in this case because the evaluation would only take place twice. Though I don't know how expensive array_slice vs. creation of another variable and assigning a value to it is But i