Re: [PHP] array sort question

2004-10-01 Thread Paul Bissex
quot;Title"] = "Test 4"; uasort() is what you need here. Also see the usort() documentation page for an example of how to write the comparison callback function that you pass to uasort(). pb -- paul bissex, e-scribe.com -- database-driven web development 413.585.8095 69.55.

Re: [PHP] set multiple variables

2004-10-01 Thread Paul Bissex
;REMOTE_ADDR'], $redirect_me)) { header ("Location: ..."); exit; } If the addresses you are targeting are ranges in CIDR format (e.g. 192.168.0.0/24), take a look at the PEAR package Net_IPv4. pb -- paul bissex, e-scribe.com -- database-driven web development 413.585.

Re: [PHP] Naming conventions

2004-10-01 Thread Paul Bissex
underscores or both? > Without getting into personal preferences I'd say that the closest thing we have to an industry standard are the PEAR conventions: http://pear.php.net/manual/en/standards.naming.php pb -- paul bissex, e-scribe.com -- database-driven web development 413.585.80

Re: [PHP] list of Months

2004-10-01 Thread Paul Bissex
ner. With apologies to the original poster for the drift and the perversity of this example: ".implode("\n",array_map(create_function('$n','return"".strftime("%b",strtotime("2004-$n-01"))."";'),range(1,12))).""; ?>

Re: [PHP] list of Months

2004-09-30 Thread Paul Bissex
selected'"; } print "$month"; } print ""; Notes (warning, many personal biases included): 1. Quote all HTML attributes. 2. Use XHTML-compatible markup for "selected" attribute, nutty as it looks. 3. Use the month name, not the number, for your d

Re: [PHP] Need some ideas

2004-09-28 Thread Paul Bissex
t. I'm all out of > brain power on thinking how to go about reading it. I typically use > simplexml to read xml and that's where my knowledge end. [snip] Sorry if this is stating the obvious, but you may have to resort to the plain ol' labor-intensive expat functions: ht

Re: [PHP] Re: Mass Mailing Using PHP

2004-09-28 Thread Paul Bissex
you are sending 100,000 messages, I'd have to guess you're a spammer, as any org with a legitimate reason to mail 100K people at once would be unlikely to be creating this script from scratch and asking basic questions in php-general. But I could be wrong.) good luck, pb -- paul bissex,

Re: [PHP] Re: simple templateing

2004-09-26 Thread Paul Bissex
bare minimum of what > you will allow in a template. I'd second the recommendation of Smarty -- as Matthew implies, you can set it up to only allow a restricted set of tags in templates, and you can define what those tags are so that they are intuitive to your template-editing users. pb -

Re: [PHP] Templates Are Driving me Nuts

2004-07-13 Thread Paul Bissex
The argument against template engines is well presented here: http://phppatterns.com/index.php/article/articleview/4/1/1/ Personally, I use Smarty for sites that need complex templating, and pure PHP templating for everything else. pb -- paul bissex, e-scribe.com -- database-driven web develop

Re: [PHP] Re: unset empty elements in an array

2004-07-12 Thread Paul Bissex
;d' => 99, 'e' => 0); print_r (array_filter ($a)); // Output: Array ( [a] => foo [d] => 99 ) As a previous poster noted, though, this will only work for you if "0" and the empty string et al. are not significant in your application. pb -- paul

Re: [PHP] Help with array / list looping syntax

2004-06-29 Thread Paul Bissex
uot; . a_an ($table['field']) . " who is..."; Any time you start typing minor variants of the same thing over and over, an alarm should go off in your head. That's what computers are here to save us from! pb -- paul bissex, e-scribe.com -- database-driven web developme

Re: [PHP] Construction

2004-06-27 Thread Paul Bissex
his design decision is, though, in either language. Anybody? pb -- paul bissex, e-scribe.com -- database-driven web development 413.585.8095 69.55.225.29 01061-0847 72°39'71"W 42°19'42"N -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Multipart Email Problem

2004-06-24 Thread Paul Bissex
I had the same problem a few months ago. I switched to Mail::mime thinking that the problem was my homebrew code, but still the same thing -- Outlook didn't recognize the message as multipart. The fix was changing the newline sequence from "\r\n" to "\n". The Mail::mime constructor allows you to