php-general Digest 31 Aug 2010 15:43:11 -0000 Issue 6919

2010-08-31 Thread php-general-digest-help
php-general Digest 31 Aug 2010 15:43:11 - Issue 6919 Topics (messages 307758 through 307765): Re: Questions about $_SERVER 307758 by: Paul M Foster 307759 by: Peter Lind 307761 by: Paul M Foster 307762 by: Peter Lind 307763 by: Paul M Foster

[PHP] a quick question about array keys

2010-08-31 Thread Tontonq Tontonq
a quick question lets say i have an array like that Array ( [300] = 300 [301] = 301 [302] = 302 [303] = 303 [304] = 304 [305] = 305 [306] = 306 [307] = 307 [308] = 308 ... how can i change keys to 0,1,2,3,.. by faster way (it should like that) Array ( [0] = 300 [1] = 301 [2] = 302 [3] =

Re: [PHP] a quick question about array keys

2010-08-31 Thread Joshua Kehn
Quickest way I can think of would be to do something like $tmp = array(); foreach($old_array as $key = $value) { $tmp[$value] = $key; } But knowing PHP there is probably some array_reverse_keys() function. Regards, -Josh Joshua Kehn |

Re: [PHP] a quick question about array keys

2010-08-31 Thread Ashley Sheridan
On Tue, 2010-08-31 at 18:43 +0300, Tontonq Tontonq wrote: a quick question lets say i have an array like that Array ( [300] = 300 [301] = 301 [302] = 302 [303] = 303 [304] = 304 [305] = 305 [306] = 306 [307] = 307 [308] = 308 ... how can i change keys to 0,1,2,3,.. by faster

Re: [PHP] a quick question about array keys

2010-08-31 Thread la...@garfieldtech.com
The fastest way is going to be array_values(): http://www.php.net/array_values --Larry Garfield On 8/31/10 10:43 AM, Tontonq Tontonq wrote: a quick question lets say i have an array like that Array ( [300] = 300 [301] = 301 [302] = 302 [303] = 303 [304] = 304 [305] = 305 [306] = 306

Re: [PHP] a quick question about array keys

2010-08-31 Thread Ashley Sheridan
On Tue, 2010-08-31 at 11:46 -0400, Joshua Kehn wrote: Quickest way I can think of would be to do something like $tmp = array(); foreach($old_array as $key = $value) { $tmp[$value] = $key; } But knowing PHP there is probably some array_reverse_keys() function. Regards,

Re: [PHP] a quick question about array keys

2010-08-31 Thread Joshua Kehn
On Aug 31, 2010, at 11:46 AM, Ashley Sheridan wrote: On Tue, 2010-08-31 at 11:46 -0400, Joshua Kehn wrote: Quickest way I can think of would be to do something like $tmp = array(); foreach($old_array as $key = $value) { $tmp[$value] = $key; } But knowing PHP there is probably

Re: [PHP] a quick question about array keys

2010-08-31 Thread Richard Quadling
On 31 August 2010 16:43, Tontonq Tontonq root...@gmail.com wrote: a quick question lets say i have an array like that Array ( [300] = 300 [301] = 301 [302] = 302 [303] = 303 [304] = 304 [305] = 305 [306] = 306 [307] = 307 [308] = 308 ... how can i change keys to 0,1,2,3,.. by

Re: [PHP] a quick question about array keys

2010-08-31 Thread Tontonq Tontonq
Ty four your all replies i got 9 replies less than 10 minutes :) than can u answer this too my array is like that for now Array ( [300] = 300 [301] = 301 [302] = 302 [303] = 303 [304] = 304 [305] = 305 [306] = 306 [307] = 307 [308] = 308 [309] = 309 [310] = 310 [311] = 311 [312] = 312 [313] = 313

Re: [PHP] a quick question about array keys

2010-08-31 Thread Ashley Sheridan
On Tue, 2010-08-31 at 19:06 +0300, Tontonq Tontonq wrote: Ty four your all replies i got 9 replies less than 10 minutes :) than can u answer this too my array is like that for now Array ( [300] = 300 [301] = 301 [302] = 302 [303] = 303 [304] = 304 [305] = 305 [306] = 306 [307] =

Re: [PHP] a quick question about array keys

2010-08-31 Thread Richard Quadling
On 31 August 2010 16:45, Ashley Sheridan a...@ashleysheridan.co.uk wrote: There are two ways I see to do it. You can iterate the array and create a copy, assigning elements dynamic values: $new_array = array(); foreach($array as $a) {    $new_array[] = $a; } or use a sorting function on

Re: [PHP] a quick question about array keys

2010-08-31 Thread Frank Arensmeier
Have a look at the manual, especially the function array_values(). /frank Skickat från min iPhone. 31 aug 2010 kl. 17:43 skrev Tontonq Tontonq root...@gmail.com: a quick question lets say i have an array like that Array ( [300] = 300 [301] = 301 [302] = 302 [303] = 303 [304] = 304

Re: [PHP] a quick question about array keys

2010-08-31 Thread Ashley Sheridan
On Tue, 2010-08-31 at 19:06 +0300, Tontonq Tontonq wrote: Ty four your all replies i got 9 replies less than 10 minutes :) than can u answer this too my array is like that for now Array ( [300] = 300 [301] = 301 [302] = 302 [303] = 303 [304] = 304 [305] = 305 [306] = 306 [307] =

Re: [PHP] a quick question about array keys

2010-08-31 Thread Ashley Sheridan
On Tue, 2010-08-31 at 16:58 +0100, Richard Quadling wrote: On 31 August 2010 16:45, Ashley Sheridan a...@ashleysheridan.co.uk wrote: There are two ways I see to do it. You can iterate the array and create a copy, assigning elements dynamic values: $new_array = array(); foreach($array

Re: [PHP] a quick question about array keys

2010-08-31 Thread Richard Quadling
On 31 August 2010 17:06, Tontonq Tontonq root...@gmail.com wrote: Array ( [300] = 300 [301] = 301 [302] = 302 [303] = 303 [304] = 304 [305] = 305 [306] = 306 [307] = 307 [308] = 308 [309] = 309 [310] = 310 [311] = 311 [312] = 312 [313] = 313 [314] = 314 [165] = 165 [166] = 166

Re: [PHP] a quick question about array keys

2010-08-31 Thread Tontonq Tontonq
i think its my mistake it will begin from first value of array it will continue until if its more big than +2 and it 2010/8/31 Ashley Sheridan a...@ashleysheridan.co.uk On Tue, 2010-08-31 at 19:06 +0300, Tontonq Tontonq wrote: Ty four your all replies i got 9 replies less than 10 minutes :)

Re: [PHP] a quick question about array keys

2010-08-31 Thread Richard Quadling
On 31 August 2010 17:39, Richard Quadling rquadl...@gmail.com wrote: On 31 August 2010 17:06, Tontonq Tontonq root...@gmail.com wrote: Array ( [300] = 300 [301] = 301 ... Not sure what happened there! ?php $data = array ( 300 = 300, 301 = 301, 302 = 302,

Re: [PHP] a quick question about array keys

2010-08-31 Thread Richard Quadling
On 31 August 2010 17:49, Richard Quadling rquadl...@gmail.com wrote: On 31 August 2010 17:39, Richard Quadling rquadl...@gmail.com wrote: On 31 August 2010 17:06, Tontonq Tontonq root...@gmail.com wrote: Array ( [300] = 300 [301] = 301 ... If you add a ... sort($data) ... just before the

Re: [PHP] Removing link on the fly, but leave link text

2010-08-31 Thread Ashley Sheridan
On Tue, 2010-08-31 at 14:31 -0500, Karl DeSaulniers wrote: Hi, Say I have some text. $text = 'You can logon here: a href=http://website.com/shop/ index.php?username='.$username.'http://website.com/shop/index.php? username='.$username.'/a. This link will take you to your web browser to

Re: [PHP] Removing link on the fly, but leave link text

2010-08-31 Thread Karl DeSaulniers
On Aug 31, 2010, at 2:32 PM, Ashley Sheridan wrote: On Tue, 2010-08-31 at 14:31 -0500, Karl DeSaulniers wrote: Hi, Say I have some text. $text = 'You can logon here: a href=http://website.com/shop/ index.php?username='.$username.'http://website.com/shop/index.php? username='.$username.'/a.

Re: [PHP] Removing link on the fly, but leave link text

2010-08-31 Thread Karl DeSaulniers
On Aug 31, 2010, at 2:34 PM, Joshua Kehn wrote: On Aug 31, 2010, at 3:31 PM, Karl DeSaulniers wrote: Hi, Say I have some text. $text = 'You can logon here: a href=http://website.com/shop/ index.php?username='.$username.'http://website.com/shop/ index.php?username='.$username.'/a. This

Re: [PHP] Removing link on the fly, but leave link text

2010-08-31 Thread Ashley Sheridan
On Tue, 2010-08-31 at 15:01 -0500, Karl DeSaulniers wrote: On Aug 31, 2010, at 2:32 PM, Ashley Sheridan wrote: On Tue, 2010-08-31 at 14:31 -0500, Karl DeSaulniers wrote: Hi, Say I have some text. $text = 'You can logon here: a href=http://website.com/shop/

[PHP] Re: Removing link on the fly, but leave link text

2010-08-31 Thread Jo�o C�ndido de Souza Neto
Try this: $pattern = array( /a [^]/, //a/ ); preg_replace($pattern, , $text); -- João Cândido de Souza Neto Karl DeSaulniers k...@designdrumm.com escreveu na mensagem news:007bc8e1-b2c8-4dd5-9d18-eb07b0d55...@designdrumm.com... Hi, Say I have some text. $text = 'You can logon

Re: [PHP] Removing link on the fly, but leave link text

2010-08-31 Thread Karl DeSaulniers
On Aug 31, 2010, at 3:06 PM, Ashley Sheridan wrote: On Tue, 2010-08-31 at 15:01 -0500, Karl DeSaulniers wrote: On Aug 31, 2010, at 2:32 PM, Ashley Sheridan wrote: On Tue, 2010-08-31 at 14:31 -0500, Karl DeSaulniers wrote: Hi, Say I have some text. $text = 'You can logon here: a

Re: [PHP] Re: Removing link on the fly, but leave link text

2010-08-31 Thread Ashley Sheridan
On Tue, 2010-08-31 at 17:15 -0300, Jo?o C?ndido de Souza Neto wrote: Theres an eror. The correct is: $pattern = array( /a [^]/, //a/ ); $text = preg_replace($pattern, , $text); -- Joo Cndido de Souza Neto Joo Cndido de Souza Neto j...@consultorweb.cnt.br escreveu

Re: [PHP] Re: Removing link on the fly, but leave link text

2010-08-31 Thread Phpster
On Aug 31, 2010, at 16:26, Ashley Sheridan a...@ashleysheridan.co.uk wrote: On Tue, 2010-08-31 at 17:15 -0300, Jo?o C?ndido de Souza Neto wrote: Theres an eror. The correct is: $pattern = array( /a [^]/, //a/ ); $text = preg_replace($pattern, , $text); -- Joo

[PHP] Looking for open source Learning Management System suggestions

2010-08-31 Thread Michael Shadle
Yes, there is Moodle. However, upon installing it, I found the admin UI to be extremely gaudy, counter-intuitive, and requires it's own learning system just to get it right (ha ha) Does anyone know of any other options out there? Obviously, open source is best, I'd even take some reasonably

Re: [PHP] Looking for open source Learning Management System suggestions

2010-08-31 Thread Bastien Koert
On Tue, Aug 31, 2010 at 7:21 PM, Michael Shadle mike...@gmail.com wrote: Yes, there is Moodle. However, upon installing it, I found the admin UI to be extremely gaudy, counter-intuitive, and requires it's own learning system just to get it right (ha ha) Does anyone know of any other options

Re: [PHP] Re: Removing link on the fly, but leave link text

2010-08-31 Thread Jim Lucas
Ashley Sheridan wrote: On Tue, 2010-08-31 at 17:15 -0300, Jo?o C?ndido de Souza Neto wrote: Theres an eror. The correct is: $pattern = array( /a [^]/, //a/ ); $text = preg_replace($pattern, , $text); -- Joo Cndido de Souza Neto Joo Cndido de Souza Neto j...@consultorweb.cnt.br

Re: [PHP] Looking for open source Learning Management System suggestions

2010-08-31 Thread Michael Shadle
On Aug 31, 2010, at 7:53 PM, Bastien Koert phps...@gmail.com wrote: Our company built one on top of wordpress. You can easily build most of it with stock plugins and it has UIs for idevices...worth considering Yeah - obviously anything can be built and a lot of things can be extended...

Re: [PHP] Looking for open source Learning Management System suggestions

2010-08-31 Thread Richard S. Crawford
I'm late to this thread, so I don't know what's been mentioned here already. However, I'd be remiss if I did not recommend Moodle (http://www.moodle.org) as an open-source learning management system. The learning curve is a bit steep, especially if you're going to mess around in the code, but it's