Re: array_shift and php 4.0.4
| From: | Gerard Samuel | Date: | Thu, 10 Jan 2002 10:27:29 +0000 |
| Subject: | Re: array_shift and php 4.0.4 | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-80004@lists.php.net to get a copy of this message | ||
Yeah its 4.0.4. I figure it strange also since array_shift was there since 4.0.0.
array_pop(), isn't that for the last element. I want to take out the first element, thus array_shift.
Ill try the regexp and see how it goes...
Ill report back
Thanks
bvr@xs4all.nl wrote:
Strange, are you sure it's 4.0.4 ?? The manual for array_shift() says it's supported from 4.0.0 . Maybe try the alias array_pop() ? otherwise there'll be other ways to strip the first part of the directory, for example using regexp, try something like: <? ereg("^[^/]/(.*)$", dirname($PHP_SELF), $regs); $c = explode("/", $regs[1]); ?> On Wed, 09 Jan 2002 22:00:49 -0500, Gerard Samuel wrote:Hey all. Im putting together a script and Im having a couple people test it out. Here is a bit of code... $c = explode ('/', dirname($PHP_SELF)); array_shift($c); It runs fine on my box, php 4.0.6, apache 1.3.22. On a box with php 4.0.4pl1, apache 1.3.20 it spits an error. Fatal error: Call to unsupported or undefined function array_shift() in file.php on line 15 Where/Is there anything wrong with 4.0.4?? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net