Re: [PHP] preg for unicode strings?

2005-11-06 Thread Niels Ganser
Andy, try that one: /^[a-zA-Z]{3}|\p{Sc}$/u You don't want to put \p{Sc} in square brackets as \p{Sc} itself already is a character class. Umm.. Kinda don't make myself clear here, do I? You just don't want to, it's 5am in the morning here I gotta go to the next bed ;p Regards, Niels Andy

Re: [PHP] preg for unicode strings?

2005-11-05 Thread Niels Ganser
Andy, you might want to check out http://www.regular-expressions.info/unicode.html Please note two things while using the described syntax: 1. You have to additionally use the u modificator. 2. While \p{Ll} for instance works in PHP, \p{Lowercase_Letter} doesn't. Regards, Niels Hi List I

Re: [PHP] foreach / unset

2005-10-27 Thread Niels Ganser
Why should this be unsafe (whatever the heck that means) in any way? Of course you can do it. Regards, Niels. [sorry for mailing to your private address. wrong button :)] Anyway, can you do *this* safely as a DOCUMENTED FEATURE: foreach($array as $k = $v){   if (...) unset($array[$k]); }

Re: [PHP] ICQ

2005-10-08 Thread Niels Ganser
so I'd suggest taking a look at the Perl libraries for ICQ/AIM and other IM clients that you can probably adapt to PHP without too much work. Check www.cpan.org for this. Or sniff the traffic of a normal ICQ client and learn the protocol that way. Alternatively you could search for a

Re: [PHP] Handling competing edits in a wiki engine?

2005-10-05 Thread Niels Ganser
Skippy: The real downside I see it having to rely on JavaScript, but that's that. The real downside - if I understand the concept correctly - ist that an open browser window isn't equal to an 'active' session. I.e. the famous lunch break still breaks the application as the ping is sent to the

Re: [PHP] Change the order in which Objects are unloaded

2005-10-04 Thread Niels Ganser
Jasper Bryant-Greene: Niels Ganser wrote: I use a Debugger-Class to collect debugging information (now that was a hard guess, wasn't it..) during script runtime. In order to collect everything there is to collect, I instantiate a debugger object right at the start of my scripts

[PHP] Sanitize paths

2005-10-01 Thread Niels Ganser
Hi, I'm working on a script which basically loads an image, the user requested and wonder how to properly sanitize the passed path. For instance the user should never ever be able to do somtehing like ?load=../../../etc/passwd. My approach so far is to simply urldecode() the given string and

Re: [PHP] Sanitize paths

2005-10-01 Thread Niels Ganser
Thanks for your reply, Philip. realpath() is your friend... That has been my first impression too, but... realpath() expands all symbolic links I am actually using symlinks :) I trust the files on my server so local redirects via symlinks are no problem, the user submitted data is.

Re: [PHP] launch app

2005-09-14 Thread Niels Ganser
No way. PHP is server based you can't trigger anything on the client side. Use Javascript, ActiveX, XUL or the like. What's the best way to send an executable to a client desktop in PHP? I'm doing a project where we need to check and see which files need to be updated on a client-desktop.

Re: [PHP] Re: Accessing images in a protected directory

2005-09-13 Thread Niels Ganser
Unfortunately, you can't pass along a username/password to apache in a simple way. Well, what about http://user:[EMAIL PROTECTED] I personally wouldn't send cleartext passwords to a client's browser which might cache them and stuff, but possible it is. -- PHP General Mailing List

Re: [PHP] array2string

2005-09-10 Thread Niels Ganser
string implode(string glue, array pieces) [1] Regards, Niels [1] http://php.net/manual/en/function.implode.php Pardon my ignorance and lack of ability to form the right search for google, but I'm trying to figure out if there's a simple function in PHP to convert array values to a string

Re: [PHP] switching php version

2005-09-10 Thread Niels Ganser
Choose the right module. Search your apache config for LoadModule php5_module resp. LoadModule php4_module. How to configure apache to select one particular from several installed php? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Convert a timestamp to RFC822??

2005-09-10 Thread Niels Ganser
Usually you can use a function in your SELECT statement to change the format of your timestamp. In MySQL it's DATE_FORMAT [1]. Otherwise use PHP's Date and Time Functions [2]. You could for instance extract the ingredients of your database's timestamp with strptime [3] and reformat it with

[PHP] Change the order in which Objects are unloaded

2005-09-09 Thread Niels Ganser
Hi everybody. I use a Debugger-Class to collect debugging information (now that was a hard guess, wasn't it..) during script runtime. In order to collect everything there is to collect, I instantiate a debugger object right at the start of my scripts and unload this object at the very end of