Reply to Re: multiple stacks, multiple versions bother anybody, or is it just me?

Your name:

Reply:


Posted by Wayne on 11/16/05 02:16

On 15 Nov 2005 10:48:25 -0800, "Rich Kucera" <usidoesit@yahoo.com>
wrote:

>I would like it to be run-time configurable in php.ini

Please god no!!!!! We've been there, we've done that. The php.ini is
not the place to put language altering directives!

>It would be really cool to be able to set that ini option in a header
>file for an application, so it wouldn't affect the entire server. Not
>sure if that is possible with compiler directives.

I think the problem is pretty rare. You're example:

$dir_path_component = array_pop(split('[/]',$dir));

is a good one. But it's not really want you want to do here. You
don't want to pop the top element off of the result, you just want to
return the first item of it. Unfortuantely, PHP doesn't allow you to
the following:

$dir_path_component = split('[/]',$dir)[0];

However, you could write your own function to handle it cleanly. Lets
call that function array_first:

function array_first($array) {
return (isset($array[0]) ? $array[0] : null;
}

$dir_path_component = array_first(split('[/]',$dir));

Problem solved.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация