Re: [PHP] Deleting elements from the middle of an array

2011-03-14 Thread Peter Lind
On Mar 15, 2011 4:10 AM, "Paul M Foster" wrote: > > On Mon, Mar 14, 2011 at 10:14:53PM +0100, Peter Lind wrote: > > > On 14 March 2011 22:10, Paul M Foster wrote: > > [snip] > > > >> Remove the elements, then use sort(). > > > > > > I've given a simplified example. The actual target array is > >

RE: [PHP] problem with if and exact match

2011-03-14 Thread Jack
Thanks everyone... great examples...works ( both methods ) Thanks! Jack > -Original Message- > From: Alexis Antonakis [mailto:ad...@antonakis.co.uk] > Sent: Tuesday, March 15, 2011 1:10 AM > To: Jack > Subject: Re: [PHP] problem with if and exact match > > http://php.net/manual/en/fu

Re: [PHP] problem with if and exact match

2011-03-14 Thread Simon J Welsh
On 15/03/2011, at 6:02 PM, Jack wrote: > I want to be able to match if a string is contained within the string I am > evaluating. > > > > I know that if ( $name == "xxjacksonxx"); based on the below would be true. > > But I want to be able to say if "jackson" is contained within $name that >

Re: [PHP] problem with if and exact match

2011-03-14 Thread Admin
Try If(preg_match("/Jackson/i", $name)) {echo 'match'; }else{ echo 'fail'; } Richard Buskirk Sent from my iPhone On Mar 15, 2011, at 1:02 AM, "Jack" wrote: > I want to be able to match if a string is contained within the string I am > evaluating. > > > > I know that if ( $name == "xxjackson

[PHP] problem with if and exact match

2011-03-14 Thread Jack
I want to be able to match if a string is contained within the string I am evaluating. I know that if ( $name == "xxjacksonxx"); based on the below would be true. But I want to be able to say if "jackson" is contained within $name that it's a match. I tried the below without success.. No

Re: [PHP] Failure in bitwise operations moving from 5.2.x to 5.3.x

2011-03-14 Thread Adam Richardson
> > This one's got me stumped. I > have the following line in a script: > > $this->bc = ($this->network | (~$this->netmask)) & 4294967295; > > $this->network and $this->netmask should both be of type long, and I > should wind up with another long. I didn't write the original method, > and I can't

Re: [PHP] Deleting elements from the middle of an array

2011-03-14 Thread Paul M Foster
On Mon, Mar 14, 2011 at 10:14:53PM +0100, Peter Lind wrote: > On 14 March 2011 22:10, Paul M Foster wrote: [snip] > >> Remove the elements, then use sort(). > > > > I've given a simplified example. The actual target array is > > multi-dimensional. Sort() won't work in a case like that, as far a

[PHP] Failure in bitwise operations moving from 5.2.x to 5.3.x

2011-03-14 Thread Andy McKenzie
Greetings, I'm moving some scripts from an older server (SuSE who-knows-what, running PHP 5.2.5) to a newer one (Ubuntu 10.10, running PHP 5.3.2). For the most part there haven't been any problems, or they've been things that I was able to fix easily. This one's got me stumped. I have the fol

Re: [PHP] Deleting elements from the middle of an array

2011-03-14 Thread Curtis Maurand
how about creating two arrays, one empty one. pop the elements you want out of the first array and push them to the second.  skip the push on the elements you don't want in the second array? Just a thought. --curtis Paul M Foster wrote: > On Mon, Mar 14, 2011 at 09:34:33PM +0100, Peter Lind w

[PHP] help with a safe mode snag

2011-03-14 Thread Jack
Hello All, Im writing a script that creates a temp file which it then encrypts and sends out in an email. This works 100% on servers that don't have safe mode, but this server with safe mode doesn't understand it's all the same user. Error: Mon Mar 14 21:10:11 2011] [error] [client 14.18.8.

Re: [PHP] Handling exit in eval

2011-03-14 Thread DELiTH
Richard Quadling wrote: > On 14 March 2011 12:14, DELiTH wrote: >> Richard Quadling wrote: >> >>> 2011/3/14 Richard Quadling : >>> >>> And where is my UNDO button. >>> >>> Essentially, having exit in the eval code is no different to having it >>> in non-eval code. eval isn't a separate entity whi

Re: [PHP] php or juvascript convert IETF format to ISO08601

2011-03-14 Thread Simon J Welsh
On 15/03/2011, at 12:32 PM, Jordan wrote: > Hello Evrybody, > > Can i convert IETF format (ex: "Wed, 18 Oct 2009 13:00:00 EST") in ISO8601 > format (ex: "2009-11-05T13:15:30Z") > > Does somebody know some php scripte or similar? > > Thanks... strtotime() (http://php.net/strtotime) and date()

[PHP] php or juvascript convert IETF format to ISO08601

2011-03-14 Thread Jordan
Hello Evrybody, Can i convert IETF format (ex: "Wed, 18 Oct 2009 13:00:00 EST") in ISO8601 format (ex: "2009-11-05T13:15:30Z") Does somebody know some php scripte or similar? Thanks... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Deleting elements from the middle of an array

2011-03-14 Thread Marc Guay
> I've given a simplified example. The actual target array is > multi-dimensional. Your questioni sn't entirely clear but there's lot of chatter about multidimensional arrays on the array_values() page that might provide a solution. -- PHP General Mailing List (http://www.php.net/) To unsubscrib

Re: [PHP] Deleting elements from the middle of an array

2011-03-14 Thread Peter Lind
On 14 March 2011 22:10, Paul M Foster wrote: > On Mon, Mar 14, 2011 at 09:34:33PM +0100, Peter Lind wrote: > >> On 14 March 2011 21:31, Paul M Foster wrote: >> > Here's what I need to do: I have an indexed array, from which I need to >> > delete elements in the middle. Once completed, the indexes

Re: [PHP] Deleting elements from the middle of an array

2011-03-14 Thread Paul M Foster
On Mon, Mar 14, 2011 at 09:34:33PM +0100, Peter Lind wrote: > On 14 March 2011 21:31, Paul M Foster wrote: > > Here's what I need to do: I have an indexed array, from which I need to > > delete elements in the middle. Once completed, the indexes should be > > numerically in sequence, as they were

Re: [PHP] Deleting elements from the middle of an array

2011-03-14 Thread Jim Lucas
On 3/14/2011 1:31 PM, Paul M Foster wrote: > Here's what I need to do: I have an indexed array, from which I need to > delete elements in the middle. Once completed, the indexes should be > numerically in sequence, as they were when I first encountered the > array. That is: > > Before: > $arr = ar

Re: [PHP] Deleting elements from the middle of an array

2011-03-14 Thread Marc Guay
> Here's what I need to do: I have an indexed array, from which I need to > delete elements in the middle. Once completed, the indexes should be > numerically in sequence, as they were when I first encountered the > array. I believe that array_values() will do the trick. Marc -- PHP General Mai

Re: [PHP] Deleting elements from the middle of an array

2011-03-14 Thread Peter Lind
On 14 March 2011 21:31, Paul M Foster wrote: > Here's what I need to do: I have an indexed array, from which I need to > delete elements in the middle. Once completed, the indexes should be > numerically in sequence, as they were when I first encountered the > array. That is: > > Before: > $arr =

[PHP] Deleting elements from the middle of an array

2011-03-14 Thread Paul M Foster
Here's what I need to do: I have an indexed array, from which I need to delete elements in the middle. Once completed, the indexes should be numerically in sequence, as they were when I first encountered the array. That is: Before: $arr = array(0 => 5, 1 => 6, 2 => 7, 3 => 8, 4 => 9, 5 => 10); Af

RE: [PHP] PHP Fatal error: Cannot redeclare class

2011-03-14 Thread Brendan_Crowley
Thanks Louis, Worked a treat! -Original Message- From: Louis Huppenbauer [mailto:louis.huppenba...@gmail.com] Sent: 14 March 2011 15:10 To: Crowley, Brendan - Dell Team Subject: Re: [PHP] PHP Fatal error: Cannot redeclare class what about http://ch2.php.net/namespaces in php 5.3? 2011/

Re: [PHP] Handling exit in eval

2011-03-14 Thread Richard Quadling
On 14 March 2011 12:14, DELiTH wrote: > Richard Quadling wrote: > >> 2011/3/14 Richard Quadling : >> >> And where is my UNDO button. >> >> Essentially, having exit in the eval code is no different to having it >> in non-eval code. eval isn't a separate entity which can be >> terminated. >> >> So,

Re: [PHP] PHP Fatal error: Cannot redeclare class

2011-03-14 Thread Daniel Brown
On Mon, Mar 14, 2011 at 10:34, wrote: > Hi, I get the following error in my apache error log: > [14-Mar-2011 14:17:27] PHP Fatal error:  Cannot redeclare class > I created a simplified set of php files and classes to formulate this > question. > I have 5 php files; 2 of which declare a class tha

[PHP] PHP Fatal error: Cannot redeclare class

2011-03-14 Thread Brendan_Crowley
Hi, I get the following error in my apache error log: [14-Mar-2011 14:17:27] PHP Fatal error: Cannot redeclare class I created a simplified set of php files and classes to formulate this question. I have 5 php files; 2 of which declare a class that has the same name in both. I know it would be ve

[PHP] assistance with php not running properly

2011-03-14 Thread Jack
Hello All, I have a problem where we tried to install mod_security for apache, failed and backed out of the install. Were not sure if that's what did it, but when we run certain php scripts they are no longer working, giving us blank screen ( web browser screen ) no errors in http error log or

Re: [PHP] Handling exit in eval

2011-03-14 Thread DELiTH
Richard Quadling wrote: > 2011/3/14 Richard Quadling : > > And where is my UNDO button. > > Essentially, having exit in the eval code is no different to having it > in non-eval code. eval isn't a separate entity which can be > terminated. > > So, code the eval code differently. > > If you can prov

Re: [PHP] Handling exit in eval

2011-03-14 Thread Richard Quadling
2011/3/14 Richard Quadling : And where is my UNDO button. Essentially, having exit in the eval code is no different to having it in non-eval code. eval isn't a separate entity which can be terminated. So, code the eval code differently. If you can provide some examples, maybe we can come up wit

Re: [PHP] Handling exit in eval

2011-03-14 Thread Richard Quadling
2011/3/14 Thomas Björk : > Is there any way to emulate an exit in eval without exiting the calling > script. > > $s = 'echo "Shows"; exit; echo "Doesn\'t show"; '; > eval($s); > echo "Never comes here"; > ?> > > > I would like to do something like this: > $s = 'echo "Shows"; exit; echo "Doesn\'t

[PHP] Handling exit in eval

2011-03-14 Thread DELiTH
Is there any way to emulate an exit in eval without exiting the calling script. I would like to do something like this: A simple return would fix it IF the return isn't located within a function. Any good suggestions? Thanks in advanced Thomas Björk -- PHP General Mailing List (http://w

[PHP] Handling exit in eval

2011-03-14 Thread Thomas Björk
Is there any way to emulate an exit in eval without exiting the calling script. I would like to do something like this: A simple return would fix it IF the return isn't located within a function. Any good suggestions? Thanks in advanced Thomas Björk -- PHP General Mailing List (http://w

Re: [PHP] Probem with go-pear.bat

2011-03-14 Thread Tommy Pham
On Sun, Mar 13, 2011 at 5:49 PM, Alejandro Crosa wrote: > Hi...I try install pear by executing the go-pear.bat file, but I get a follow >  message: > > The go.pear.phar.dll is not a image valid of  windows. > > Please, any help is important for me. > > Thanks. > > Alejandro > > > See http://pear