RE: [PHP] Formatting phone numbers?

2004-04-17 Thread Andy Crain
Jay, > Here is a little more of the larger function with comments (more > comments than code, which is never a Bad Thing [tm]). I am only showing > the handling for two basic types of telephone numbers with explanation > for additional verification which we would typically use, since we have > tho

RE: [PHP] Formatting phone numbers?

2004-04-16 Thread Andy Crain
Good stuff. > [stuff you may not need] > This is a boiled down version of a longer function that counts string > lengths to determine how many dashes might need to be added. Let's say > you have the area code in the number, like 2108765432. Being a ten digit > number with a recognizable area code

RE: [PHP] Re: IPTC image comments utility

2004-02-12 Thread Andy Crain
This might help: http://pear.php.net/package/Image_IPTC Andy > -Original Message- > From: Paul Furman [mailto:[EMAIL PROTECTED] > Sent: Thursday, February 12, 2004 7:36 PM > To: [EMAIL PROTECTED] > Subject: [PHP] Re: IPTC image comments utility > > OK this looks like the thing: > http://m

RE: [PHP] Singleton Was: [PHP] OO parent/child relationship

2003-10-07 Thread Andy Crain
03 5:36 PM > To: 'PHP List' > Subject: [PHP] Singleton Was: [PHP] OO parent/child relationship > > Gerard Samuel wrote: > > > Andy Crain wrote: > > > >> This all seems like a perfect case for the singleton pattern. See > >> http://

RE: [PHP] OO parent/child relationship

2003-10-06 Thread Andy Crain
This all seems like a perfect case for the singleton pattern. See http://www.phppatterns.com/index.php/article/articleview/6/1/1/ and http://www.phppatterns.com/index.php/article/articleview/75/1/1/ Andy > -Original Message- > From: Evan Nemerson [mailto:[EMAIL PROTECTED] > Sent: Monday, O

RE: [PHP] Re: rich text editing

2003-08-22 Thread Andy Crain
The only problem in doing so, for me at least, is in editing text created by htmlarea. Nonsupported users who get a normal textarea pre-loaded with html generated by htmlarea could break tags, etc., on updates. I wrote a class I use to work around this by: determining which type of textarea they'll

RE: [PHP] OO function overloading?

2003-08-14 Thread Andy Crain
Or, if you'd rather not use an experimental extension, there's this hack (learned from http://www.phpbuilder.com/columns/luis2420.php3): class MyClass{ function MyClass(){ $name = 'MyClass' . func_num_args(); $this->$name(); } function

[PHP] question on preg_replace()

2003-02-26 Thread Andy Crain
I'm having a problem figuring out how to prevent preg_replace() from replacing substrings when one element of the pattern array matches a portion of a string that would match a subsequent value in the pattern array. Say I have an two arrays: find => Array ( [0] => 'f

RE: [PHP] preg_match question: locating unmatched HTML tags

2003-02-22 Thread Andy Crain
d to check the output of that to make sure there aren't any extraneous tags. Andy > -Original Message- > From: John W. Holmes [mailto:[EMAIL PROTECTED] > Sent: Saturday, February 22, 2003 5:04 PM > To: 'Andy Crain'; [EMAIL PROTECTED] > Subject: RE: [PHP] preg_matc

RE: [PHP] preg_match question: locating unmatched HTML tags

2003-02-22 Thread Andy Crain
n checking its first match, at . Andy > -Original Message- > From: Ernest E Vogelsinger [mailto:[EMAIL PROTECTED] > Sent: Saturday, February 22, 2003 5:48 AM > To: Andy Crain > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP] preg_match question: locating unmatched HTML tags >

RE: [PHP] preg_match question: locating unmatched HTML tags

2003-02-22 Thread Andy Crain
TED] > Sent: Saturday, February 22, 2003 1:06 AM > To: 'Andy Crain'; [EMAIL PROTECTED] > Subject: RE: [PHP] preg_match question: locating unmatched HTML tags > > > I'm trying to build a regexp that would parse user-supplied text and > > identify cases where

[PHP] preg_match question: locating unmatched HTML tags

2003-02-21 Thread Andy Crain
My apologies in advance if this too basic or there's a solution easily found out there, but after lots of searching, I'm still lost. I'm trying to build a regexp that would parse user-supplied text and identify cases where HTML tags are left open or are not properly matched-e.g., tags without

[PHP] Help with file()--certain URLs causing error

2003-02-05 Thread Andy Crain
Hi, I'm having trouble using file() to get the text of web pages for an in-house URL directory and search engine I'm trying to build. I'm using something along the lines of the following code to take a user-submitted URL and then fetch the text of the page at that address and store it in a databas

RE: [PHP] Returning a value from a recursive function

2003-01-22 Thread Andy Crain
- > From: Brian T. Allen [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, January 22, 2003 4:47 PM > To: 'Andy Crain'; [EMAIL PROTECTED] > Subject: RE: [PHP] Returning a value from a recursive function > > I think it will work if you return true, and just modify the gl

[PHP] Returning a value from a recursive function

2003-01-22 Thread Andy Crain
Everyone, I'm stumped by this, even after searching the archives and the web, although I admit the solution likely is something very obvious. I've written a function to build a string of "breadcrumb" links for a web site directory similar to Yahoo, etc. It queries a categories table recursivel

RE: [PHP] Trouble with understanding arrays

2002-10-02 Thread Andy Crain
It looks like your problem is simply in the debug line, where you echo print_r(array_values($TickersCurrent)); You shouldn't call array_values() before print_r(), since array_values generates an indexed array of only the values (quotes), not the keys (tickers), of the supplied array, essentially t