Re: [PHP] parsing select multiple=multiple

2013-02-21 Thread Jim Giner
I *have* heard claims that something like this is preferrable, though: if (FALSE === $variable) I believe I read a comment somewhere once that writing your IF statements that way helped to trigger an error message when the coder forgot to use the double equal sign (==) in the statement. I

Re: [PHP] parsing select multiple=multiple

2013-02-21 Thread tamouse mailing lists
On Thu, Feb 21, 2013 at 8:46 AM, Jim Giner jim.gi...@albanyhandball.com wrote: I *have* heard claims that something like this is preferrable, though: if (FALSE === $variable) I believe I read a comment somewhere once that writing your IF statements that way helped to trigger an error

Re: [PHP] parsing select multiple=multiple

2013-02-20 Thread Tedd Sperling
On Feb 18, 2013, at 7:54 PM, John Taylor-Johnston john.taylor-johns...@cegepsherbrooke.qc.ca wrote: I am capable with select name=DPRpriority. (I suppose I did it correctly? :p ) But I haven't the first clue how to parse a select multiple and multiply select name=DPRtype. Would anyone

Re: [PHP] parsing select multiple=multiple

2013-02-20 Thread Jim Giner
On 2/20/2013 11:41 AM, Tedd Sperling wrote: On Feb 18, 2013, at 7:54 PM, John Taylor-Johnston john.taylor-johns...@cegepsherbrooke.qc.ca wrote: I am capable with select name=DPRpriority. (I suppose I did it correctly? :p ) But I haven't the first clue how to parse a select multiple and

Re: [PHP] parsing select multiple=multiple

2013-02-20 Thread tamouse mailing lists
On Tue, Feb 19, 2013 at 1:02 PM, John Taylor-Johnston john.taylor-johns...@cegepsherbrooke.qc.ca wrote: tamouse mailing lists wrote: I hate arrays. :D Here's a small snippet showing how it works, I hope: foreach ($DPRpriority as $item = $value) { echo li .$item.: .$value['name'].

Re: [PHP] parsing select multiple=multiple

2013-02-19 Thread John Taylor-Johnston
tamouse mailing lists wrote: I hate arrays. :D Here's a small snippet showing how it works, I hope: foreach ($DPRpriority as $item = $value) { echo li .$item.: .$value['name']. selected: .$value['selected']. /li\n; } Question 1: when did we have to add [] to a input name to turn it into

Re: [PHP] parsing select multiple=multiple

2013-02-19 Thread Jim Giner
On 2/19/2013 2:02 PM, John Taylor-Johnston wrote: tamouse mailing lists wrote: I hate arrays. :D Here's a small snippet showing how it works, I hope: foreach ($DPRpriority as $item = $value) { echo li .$item.: .$value['name']. selected: .$value['selected']. /li\n; } Question 1: when did

[PHP] parsing select multiple=multiple

2013-02-18 Thread John Taylor-Johnston
I am capable with select name=DPRpriority. (I suppose I did it correctly? :p ) But I haven't the first clue how to parse a select multiple and multiply select name=DPRtype. Would anyone give me a couple of clues please? :) Thanks, John Priority: select name=DPRpriority

Re: [PHP] parsing select multiple=multiple

2013-02-18 Thread tamouse mailing lists
On Mon, Feb 18, 2013 at 6:54 PM, John Taylor-Johnston john.taylor-johns...@cegepsherbrooke.qc.ca wrote: I am capable with select name=DPRpriority. (I suppose I did it correctly? :p ) But I haven't the first clue how to parse a select multiple and multiply select name=DPRtype. Would anyone

Re: [PHP] parsing select multiple=multiple

2013-02-18 Thread John Taylor-Johnston
select multiple=multiple name=DPRtype form=DPRform option value=1. Crimes Against Persons1. Crimes Against Persons/option option value=2. Disturbances2. Disturbances/option option value=3. Assistance / Medical3. Assistance / Medical/option

Re: [PHP] parsing select multiple=multiple

2013-02-18 Thread David Robley
tamouse mailing lists wrote: On Mon, Feb 18, 2013 at 6:54 PM, John Taylor-Johnston john.taylor-johns...@cegepsherbrooke.qc.ca wrote: I am capable with select name=DPRpriority. (I suppose I did it correctly? :p ) But I haven't the first clue how to parse a select multiple and multiply select

Re: [PHP] parsing select multiple=multiple

2013-02-18 Thread tamouse mailing lists
On Mon, Feb 18, 2013 at 7:28 PM, John Taylor-Johnston john.taylor-johns...@cegepsherbrooke.qc.ca wrote: select multiple=multiple name=DPRtype form=DPRform option value=1. Crimes Against Persons1. Crimes Against Persons/option option value=2. Disturbances2.

Re: [PHP] Parsing the From field

2011-11-20 Thread Geoff Shang
On Sat, 19 Nov 2011, Ron Piggott wrote: Also the formatting of the from field changes in various e-mail programs: From: Ron Piggott ron.pigg...@actsministries.org From: Ron Piggott ron.pigg...@actsministries.org From: ron.pigg...@actsministries.org From: ron.pigg...@actsministries.org I've

[PHP] Parsing the From field

2011-11-19 Thread Ron Piggott
I am unsure of how to parse first name, last name and e-mail address from the 'From:' field of an e-mail. What I am struggling with is if the name has more than two words - Such as the last name being multiple words - A name a business or department is given instead of a personal name - If the

Re: [PHP] Parsing the From field

2011-11-19 Thread Alain Williams
On Sat, Nov 19, 2011 at 11:23:59AM -0500, Ron Piggott wrote: I am unsure of how to parse first name, last name and e-mail address from the 'From:' field of an e-mail. What I am struggling with is if the name has more than two words - Such as the last name being multiple words - A name a

Re: [PHP] Parsing the From field

2011-11-19 Thread Ron Piggott
Cc: php-general@lists.php.net Subject: Re: [PHP] Parsing the From field On Sat, Nov 19, 2011 at 11:23:59AM -0500, Ron Piggott wrote: I am unsure of how to parse first name, last name and e-mail address from the 'From:' field of an e-mail. What I am struggling with is if the name has more than

Re: [PHP] Parsing the From field

2011-11-19 Thread Al
On 11/19/2011 11:29 AM, Alain Williams wrote: On Sat, Nov 19, 2011 at 11:23:59AM -0500, Ron Piggott wrote: I am unsure of how to parse first name, last name and e-mail address from the 'From:' field of an e-mail. What I am struggling with is if the name has more than two words - Such as

[PHP] Parsing a simple sql string in php

2011-05-06 Thread Ashley Sheridan
Hiya, has anyone had any experience with parsing a string of sql to break it down into its component parts? At the moment I'm using several regex's to parse a string, which works, but I'm sure there's a more elegant solution. The general idea is to produce a nice looking page giving details of

Re: [PHP] Parsing a simple sql string in php

2011-05-06 Thread Stuart Dallas
On Friday, 6 May 2011 at 10:05, Ashley Sheridan wrote: Hiya, has anyone had any experience with parsing a string of sql to break it down into its component parts? At the moment I'm using several regex's to parse a string, which works, but I'm sure there's a more elegant solution. The general

Re: [PHP] Parsing a simple sql string in php

2011-05-06 Thread Ken Guest
On Fri, May 6, 2011 at 10:05 AM, Ashley Sheridan a...@ashleysheridan.co.uk wrote: Hiya, has anyone had any experience with parsing a string of sql to break it down into its component parts? At the moment I'm using several regex's to parse a string, which works, but I'm sure there's a more

Re: [PHP] Parsing a simple sql string in php

2011-05-06 Thread Ashley Sheridan
Ken Guest k...@linux.ie wrote: On Fri, May 6, 2011 at 10:05 AM, Ashley Sheridan a...@ashleysheridan.co.uk wrote: Hiya, has anyone had any experience with parsing a string of sql to break it down into its component parts? At the moment I'm using several regex's to parse a string, which works, but

[PHP] Parsing a phrase

2010-12-12 Thread Rick Dwyer
Hello all. I have a page where the user can enter a search phrase and upon submitting, the search phrase is queried in MySQL. However, I need to modify is so each word in the phrase is searched for... not just the exact phrase. So, big blue hat will return results like: A big hat - blue

[PHP] Parsing JSON; back-slash problem

2009-12-15 Thread Andrew Burgess
This seems like a pretty basic question, but it has me stumped. Here's my scenario: I'm using Douglas Crockford's JSON2.js to parse an object in JavaScript, which I then pass to a PHP script to store in a file. I use JSON.stringify() on the object, which logs to the console as this:

Re: [PHP] Parsing JSON; back-slash problem

2009-12-15 Thread Ashley Sheridan
On Tue, 2009-12-15 at 06:52 -0500, Andrew Burgess wrote: This seems like a pretty basic question, but it has me stumped. Here's my scenario: I'm using Douglas Crockford's JSON2.js to parse an object in JavaScript, which I then pass to a PHP script to store in a file. I use JSON.stringify()

Re: [PHP] Parsing JSON; back-slash problem

2009-12-15 Thread Shawn McKenzie
Ashley Sheridan wrote: On Tue, 2009-12-15 at 06:52 -0500, Andrew Burgess wrote: This seems like a pretty basic question, but it has me stumped. Here's my scenario: I'm using Douglas Crockford's JSON2.js to parse an object in JavaScript, which I then pass to a PHP script to store in a file.

Re: [PHP] Parsing JSON; back-slash problem

2009-12-15 Thread Wouter van Vliet / Interpotential
If you don't have access to do this, look at stripslashes() And if you absolutely want to be on the safe side - check* if the magic_quotes option is enabled - if so; do stripslashes. If not - then obviously don't. * http://www.php.net/manual/en/function.get-magic-quotes-gpc.php --

Re: [PHP] Parsing JSON; back-slash problem

2009-12-15 Thread Andrew Burgess
Thanks guys; I've got it working now! On Tue, Dec 15, 2009 at 9:54 AM, Wouter van Vliet / Interpotential pub...@interpotential.com wrote: If you don't have access to do this, look at stripslashes() And if you absolutely want to be on the safe side - check* if the magic_quotes option is

[PHP] Re: newbie question - php parsing

2009-07-23 Thread Peter Ford
João Cândido de Souza Neto wrote: You made a mistake in your code: ?php the_title(); ? must be: ?php echo the_title(); ? Not necessarily: what if you have function the_title() { echo Title; } for example... In response to Sebastiano: There would be not much point in using

Re: [PHP] Re: newbie question - php parsing

2009-07-23 Thread Sebastiano Pomata
Thanks, it's now much more clear. I thought that html parts outside php tags were just dumped to output, no matter of if-else statements and other conditions. I was *definitely* wrong 2009/7/23 Peter Ford p...@justcroft.com: In response to Sebastiano: There would be not much point in using

[PHP] newbie question - php parsing

2009-07-22 Thread Sebastiano Pomata
Hi all, A little doubt caught me while I was writing this snippet of code for a wordpress template: ?php if (the_title('','',FALSE) != 'Home') { ? h2 class=entry-header?php the_title(); ?/h2 ?php } ? I always thought that php was called only between the ?php ? tags, and I'm pretty sure that's

[PHP] Re: newbie question - php parsing

2009-07-22 Thread Jo�o C�ndido de Souza Neto
You made a mistake in your code: ?php the_title(); ? must be: ?php echo the_title(); ? -- João Cândido de Souza Neto SIENS SOLUÇÕES EM GESTÃO DE NEGÓCIOS Fone: (0XX41) 3033-3636 - JS www.siens.com.br Sebastiano Pomata lafayett...@gmail.com escreveu na mensagem

Re: [PHP] Re: newbie question - php parsing

2009-07-22 Thread Shane Hill
2009/7/22 João Cândido de Souza Neto j...@consultorweb.cnt.br You made a mistake in your code: ?php the_title(); ? must be: ?php echo the_title(); ? ?= the_title(); ? also works. -Shane -- João Cândido de Souza Neto SIENS SOLUÇÕES EM GESTÃO DE NEGÓCIOS Fone: (0XX41) 3033-3636

Re: [PHP] Re: newbie question - php parsing

2009-07-22 Thread Lenin
Ted Turner http://www.brainyquote.com/quotes/authors/t/ted_turner.html - Sports is like a war without the killing. 2009/7/23 Shane Hill shanehil...@gmail.com 2009/7/22 João Cândido de Souza Neto j...@consultorweb.cnt.br You made a mistake in your code: ?php the_title(); ? must be:

Re: [PHP] Re: newbie question - php parsing

2009-07-22 Thread Martin Scotta
This is how I'd write this snippet ?php if ( 'Home' !== ( $title = the_title('','',FALSE))) { echo 'h2 class=entry-header', $title, '/h2'; } ? On Wed, Jul 22, 2009 at 6:31 PM, Lenin le...@phpxperts.net wrote: Ted Turner

[PHP] Re: newbie question - php parsing

2009-07-22 Thread Shawn McKenzie
João Cândido de Souza Neto wrote: You made a mistake in your code: ?php the_title(); ? must be: ?php echo the_title(); ? I haven't used worpress in a long time, but the the_title() function might echo the title unless you pass the FALSE parameter, in which case it just returns it. --

[PHP] Parsing of forms

2009-05-16 Thread Daniele Grillenzoni
I noticed that php's way to fill $_GET and $_POST is particularly inefficient when it comes to handling multiple inputs with the same name. This basically mean that every select multiple in order to function properly needs to have a name ending in '[]'. Wouldn't it be easier to also make it

[PHP] Parsing of forms

2009-05-16 Thread Daniele Grillenzoni
I noticed that php's way to fill $_GET and $_POST is particularly inefficient when it comes to handling multiple inputs with the same name. This basically mean that every select multiple in order to function properly needs to have a name ending in '[]'. Wouldn't it be easier to also make it

Re: [PHP] Parsing HTML href-Attribute

2009-01-18 Thread Benjamin Hawkes-Lewis
On 16/1/09 23:41, Shawn McKenzie wrote: Again, I say that it won't work on URLs with spaces, like my web page.html. When I get a minute I'll fix it. I thought spaces in URLs weren't valid markup, but it seems to validate. Some small points of information: An HTML4 validator will only check

Re: [PHP] Parsing HTML href-Attribute

2009-01-18 Thread Micah Gersten
Depending on the goal, using the base tag in the head section might help: http://www.w3.org/TR/REC-html40/struct/links.html#h-12.4 Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com Edmund Hertle wrote: Hey, I want to parse a href-attribute in a given String

RE: [PHP] Parsing HTML href-Attribute

2009-01-16 Thread Boyd, Todd M.
-Original Message- From: farn...@googlemail.com [mailto:farn...@googlemail.com] On Behalf Of Edmund Hertle Sent: Thursday, January 15, 2009 4:13 PM To: PHP - General Subject: [PHP] Parsing HTML href-Attribute Hey, I want to parse a href-attribute in a given String to check

Re: [PHP] Parsing HTML href-Attribute

2009-01-16 Thread Shawn McKenzie
Boyd, Todd M. wrote: -Original Message- From: farn...@googlemail.com [mailto:farn...@googlemail.com] On Behalf Of Edmund Hertle Sent: Thursday, January 15, 2009 4:13 PM To: PHP - General Subject: [PHP] Parsing HTML href-Attribute Hey, I want to parse a href-attribute in a given

Re: [PHP] Parsing HTML href-Attribute

2009-01-16 Thread Eric Butera
On Thu, Jan 15, 2009 at 5:13 PM, Edmund Hertle edmund.her...@student.kit.edu wrote: Hey, I want to parse a href-attribute in a given String to check if there is a relative link and then adding an absolute path. Example: $string = 'a class=sample [...additional attributes...]

Re: [PHP] Parsing HTML href-Attribute

2009-01-16 Thread mike
On Fri, Jan 16, 2009 at 10:54 AM, Eric Butera eric.but...@gmail.com wrote: You could also use DOM for this. http://us2.php.net/manual/en/domdocument.getelementsbytagname.php only if it's parseable xml :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] Parsing HTML href-Attribute

2009-01-16 Thread mike
On Fri, Jan 16, 2009 at 10:58 AM, mike mike...@gmail.com wrote: only if it's parseable xml :) Or not! Ignore me. Supposedly this can handle HTML too. I'll have to try it next time. Normally I wind up having to use tidy to scrub a document and try to get it into xhtml and then use simplexml. I

Re: [PHP] Parsing HTML href-Attribute

2009-01-16 Thread Eric Butera
On Fri, Jan 16, 2009 at 1:59 PM, mike mike...@gmail.com wrote: On Fri, Jan 16, 2009 at 10:58 AM, mike mike...@gmail.com wrote: only if it's parseable xml :) Or not! Ignore me. Supposedly this can handle HTML too. I'll have to try it next time. Normally I wind up having to use tidy to scrub

Re: [PHP] Parsing HTML href-Attribute

2009-01-16 Thread Shawn McKenzie
Shawn McKenzie wrote: Boyd, Todd M. wrote: -Original Message- From: farn...@googlemail.com [mailto:farn...@googlemail.com] On Behalf Of Edmund Hertle Sent: Thursday, January 15, 2009 4:13 PM To: PHP - General Subject: [PHP] Parsing HTML href-Attribute Hey, I want to parse a href

RE: [PHP] Parsing HTML href-Attribute

2009-01-16 Thread Boyd, Todd M.
-Original Message- From: Shawn McKenzie [mailto:nos...@mckenzies.net] Sent: Friday, January 16, 2009 1:08 PM To: php-general@lists.php.net Subject: Re: [PHP] Parsing HTML href-Attribute Shawn McKenzie wrote: Boyd, Todd M. wrote: -Original Message- From: farn

Re: [PHP] Parsing HTML href-Attribute

2009-01-16 Thread Shawn McKenzie
Boyd, Todd M. wrote: -Original Message- From: Shawn McKenzie [mailto:nos...@mckenzies.net] Sent: Friday, January 16, 2009 1:08 PM To: php-general@lists.php.net Subject: Re: [PHP] Parsing HTML href-Attribute Shawn McKenzie wrote: Boyd, Todd M. wrote: -Original Message

Re: [PHP] Parsing HTML href-Attribute

2009-01-16 Thread Shawn McKenzie
I believe the OP wanted to leave already-absolute paths alone (i.e., only convert relative paths). The regex does not take into account fully-qualified URLs (i.e., http://www.google.com/search?q=php) and it does not determine if a given path is relative or absolute. He was wanting to take the

RE: [PHP] Parsing HTML href-Attribute

2009-01-16 Thread Boyd, Todd M.
-Original Message- From: Shawn McKenzie [mailto:nos...@mckenzies.net] Sent: Friday, January 16, 2009 2:37 PM To: php-general@lists.php.net Subject: Re: [PHP] Parsing HTML href-Attribute Hey, I want to parse a href-attribute in a given String to check if there is a relative

Re: [PHP] Parsing HTML href-Attribute

2009-01-16 Thread Edmund Hertle
* http://www.google.com/search?q=php ... absolute path (yes, it's a URL, but treat it as absolute) * https://www.example.com/index.php ... absolute path (yes, it's a URL, but to the local server) * /index.php ... absolute path (no protocol given, true absolute path) * index.php ... relative

Re: [PHP] Parsing HTML href-Attribute

2009-01-16 Thread Kevin Waterson
This one time, at band camp, mike mike...@gmail.com wrote: On Fri, Jan 16, 2009 at 10:58 AM, mike mike...@gmail.com wrote: only if it's parseable xml :) Or not! Ignore me. Supposedly this can handle HTML too. I'll have to try it next time. Normally I wind up having to use tidy to scrub

Re: [PHP] Parsing HTML href-Attribute

2009-01-16 Thread Kevin Waterson
This one time, at band camp, Eric Butera eric.but...@gmail.com wrote: You could also use DOM for this. http://us2.php.net/manual/en/domdocument.getelementsbytagname.php http://www.phpro.org/examples/Get-Links-With-DOM.html Kevin -- PHP General Mailing List (http://www.php.net/) To

Re: [PHP] Parsing HTML href-Attribute

2009-01-16 Thread Shawn McKenzie
Edmund Hertle wrote: * http://www.google.com/search?q=php ... absolute path (yes, it's a URL, but treat it as absolute) * https://www.example.com/index.php ... absolute path (yes, it's a URL, but to the local server) * /index.php ... absolute path (no protocol given, true absolute path) *

Re: [PHP] Parsing HTML href-Attribute

2009-01-16 Thread Eric Butera
On Fri, Jan 16, 2009 at 6:18 PM, Kevin Waterson ke...@phpro.org wrote: This one time, at band camp, Eric Butera eric.but...@gmail.com wrote: You could also use DOM for this. http://us2.php.net/manual/en/domdocument.getelementsbytagname.php

[PHP] Parsing HTML href-Attribute

2009-01-15 Thread Edmund Hertle
Hey, I want to parse a href-attribute in a given String to check if there is a relative link and then adding an absolute path. Example: $string = 'a class=sample [...additional attributes...] href=/foo/bar.php '; I tried using regular expressions but my knowledge of RegEx is very limited. Things

Re: [PHP] Parsing HTML href-Attribute

2009-01-15 Thread Murray
Hi Edmund, You want a regex that looks something like this: $result = preg_replace('%(href=)(|\')(?!c:/)(.+?)(|\')%', '\1\2c:/my_absolute_path\3\4', $subject); This example assumes that your absolute path begins with c:/. You would change this to whatever suits. You would also change

Re: [PHP] Parsing Strings

2008-12-07 Thread German Geek
Why not preg_split ( http://nz.php.net/manual/en/function.preg-split.php ): $str = 'SCOTTSDALE, AZ 85254'; $ar = preg_split('/,? ?/', $str); //optional comma, followed by optional space // $ar = array('SCOTTSDALE', 'AZ', '85254'); On Sat, Dec 6, 2008 at 1:18 PM, Jason Todd Slack-Moehrle [EMAIL

Re: [PHP] Parsing Strings

2008-12-06 Thread tedd
At 4:18 PM -0800 12/5/08, Jason Todd Slack-Moehrle wrote: How might I also parse and address like: SCOTTSDALE, AZ 85254 It has a comma and a space -Jason On Dec 5, 2008, at 4:02 PM, Jason Todd Slack-Moehrle wrote: OK, making good learning progress today. I have a string that is: Jason

Re: [PHP] Parsing Strings

2008-12-06 Thread VamVan
u can use split() or explode (). Thanks On Sat, Dec 6, 2008 at 9:27 AM, tedd [EMAIL PROTECTED] wrote: At 4:18 PM -0800 12/5/08, Jason Todd Slack-Moehrle wrote: How might I also parse and address like: SCOTTSDALE, AZ 85254 It has a comma and a space -Jason On Dec 5, 2008, at 4:02 PM,

Re: [PHP] Parsing Strings

2008-12-06 Thread Nathan Rixham
tedd wrote: At 4:18 PM -0800 12/5/08, Jason Todd Slack-Moehrle wrote: How might I also parse and address like: SCOTTSDALE, AZ 85254 It has a comma and a space -Jason On Dec 5, 2008, at 4:02 PM, Jason Todd Slack-Moehrle wrote: OK, making good learning progress today. I have a string that

[PHP] Parsing Strings

2008-12-05 Thread Jason Todd Slack-Moehrle
OK, making good learning progress today. I have a string that is: Jason Slack and I want it broken at the space so i get Jason and then Slack I am looking at parse_str, but I dont get how to do it with a space. The example is using []=. Then I want to assign like: $fname = Jason; $lname =

Re: [PHP] Parsing Strings

2008-12-05 Thread Jason Todd Slack-Moehrle
How might I also parse and address like: SCOTTSDALE, AZ 85254 It has a comma and a space -Jason On Dec 5, 2008, at 4:02 PM, Jason Todd Slack-Moehrle wrote: OK, making good learning progress today. I have a string that is: Jason Slack and I want it broken at the space so i get Jason and

AW: [PHP] Parsing Strings

2008-12-05 Thread Konrad Priemer
Hi, Jason wrote: I have a string that is: Jason Slack and I want it broken at the space so i get Jason and then Slack explode or split can do this. $array = explode( , Jason Slack); Array ( [0] = Jason [1] = Slack ) Greetings from Stuttgart Conny --- Firma Konrad Priemer

Re: AW: [PHP] Parsing Strings

2008-12-05 Thread Jason Todd Slack-Moehrle
Konrad, On Dec 5, 2008, at 4:22 PM, Konrad Priemer wrote: $array = explode( , Jason Slack); Awesome, thanks, yup that does it. Can you explain how to do an address now into City, State, Zip Like: cortland, ny 13045 It has a comma and a space! -Jason -- PHP General Mailing List

AW: AW: [PHP] Parsing Strings

2008-12-05 Thread Konrad Priemer
Hi, On Sa 06.12.2008 01:30 Jason wrote: Can you explain how to do an address now into City, State, Zip Like: cortland, ny 13045 Test this: $string = cortland, ny 13045; $search = array(, , ,); # if there is no space after the comma, we make this ;-) $replace = array( , ); $newString =

Re: AW: [PHP] Parsing Strings

2008-12-05 Thread Jason Todd Slack-Moehrle
Conny, Can you explain how to do an address now into City, State, Zip Like: cortland, ny 13045 $string = cortland, ny 13045; $search = array(, , ,); $replace = array( , ); $newString = str_replace($search, $replace, $string); $array = explode( , $newString); Ah ha! Nice that makes sense,

AW: [PHP] Parsing Strings

2008-12-05 Thread Konrad Priemer
Oups, sorry mistake by copy paste ;-) On Sa 06.12.2008 01:30 Jason wrote: Can you explain how to do an address now into City, State, Zip Like: cortland, ny 13045 $string = cortland, ny 13045; $search = array(, , ,); $replace = array( , ); $newString =

Re: [PHP] Parsing XML

2008-12-01 Thread Peter Ford
Per Jessen wrote: Ashley Sheridan wrote: On Fri, 2008-11-28 at 10:15 +0100, Per Jessen wrote: Ashley Sheridan wrote: Do any of you have a copy of this extension, or failing that, a suggestion of how I can parse XML files without having to install anything on the remote server, as I do not

Re: [PHP] Parsing XML

2008-12-01 Thread Per Jessen
Peter Ford wrote: Per Jessen wrote: That's cool, but XSL is still the more appropriate tool IMO. It does exactly what you need - it parses and validates the XML document, allows you to extract the bits you need and in virtually any format you need - which could be a text document with SQL

Re: [PHP] Parsing XML

2008-12-01 Thread Ashley Sheridan
On Mon, 2008-12-01 at 11:28 +0100, Per Jessen wrote: Peter Ford wrote: Per Jessen wrote: That's cool, but XSL is still the more appropriate tool IMO. It does exactly what you need - it parses and validates the XML document, allows you to extract the bits you need and in virtually

Re: [PHP] Parsing XML

2008-12-01 Thread Per Jessen
Ashley Sheridan wrote: I still disagree, as using XSL is essentially converting the XML to another format, Which is all you're doing when you're extracting parts of an XML document. which is then being used by PHP. XSL is great for some tasks, but for this, I think having a good PHP

Re: [PHP] Parsing XML

2008-12-01 Thread Ashley Sheridan
On Mon, 2008-12-01 at 21:35 +0100, Per Jessen wrote: Ashley Sheridan wrote: I still disagree, as using XSL is essentially converting the XML to another format, Which is all you're doing when you're extracting parts of an XML document. which is then being used by PHP. XSL is great

Re: [PHP] Parsing XML

2008-12-01 Thread Per Jessen
Ashley Sheridan wrote: Roughly like this: (this is from a project I'm currently working on). -- // create the xslt processor object if ( FALSE===($xp=new XSLTProcessor()) ) { print unable to create xslt engine; return FALSE; } // Load the XML source $xml=new DOMDocument;

Re: [PHP] Parsing XML

2008-12-01 Thread Nathan Rixham
Per Jessen wrote: Ashley Sheridan wrote: [/snip] :p XSL(T) an xslt processor, along with an XSLT stylesheet, should be used to transform XML documents in to other XML, human readable or structured documents. DOM a class implementing the DOM interface should be used to traverse, analyse

Re: [PHP] Parsing XML

2008-11-29 Thread Ashley Sheridan
On Fri, 2008-11-28 at 20:39 +0100, Per Jessen wrote: Andrew Ballard wrote: XSL will only allow me to convert it into a different document format, which is not what I want as I need to keep a local copy of information in a database for searching and sorting purposes. Nathans class allows

Re: [PHP] Parsing XML

2008-11-28 Thread Per Jessen
Ashley Sheridan wrote: Do any of you have a copy of this extension, or failing that, a suggestion of how I can parse XML files without having to install anything on the remote server, as I do not have that level off access to it. Parsing XML is best done with XSL - if that's out of the

Re: [PHP] Parsing XML

2008-11-28 Thread Ashley Sheridan
On Fri, 2008-11-28 at 10:15 +0100, Per Jessen wrote: Ashley Sheridan wrote: Do any of you have a copy of this extension, or failing that, a suggestion of how I can parse XML files without having to install anything on the remote server, as I do not have that level off access to it.

Re: [PHP] Parsing XML

2008-11-28 Thread Per Jessen
Ashley Sheridan wrote: On Fri, 2008-11-28 at 10:15 +0100, Per Jessen wrote: Ashley Sheridan wrote: Do any of you have a copy of this extension, or failing that, a suggestion of how I can parse XML files without having to install anything on the remote server, as I do not have that level

Re: [PHP] Parsing XML

2008-11-28 Thread Ashley Sheridan
On Fri, 2008-11-28 at 13:14 +0100, Per Jessen wrote: Ashley Sheridan wrote: On Fri, 2008-11-28 at 10:15 +0100, Per Jessen wrote: Ashley Sheridan wrote: Do any of you have a copy of this extension, or failing that, a suggestion of how I can parse XML files without having to install

Re: [PHP] Parsing XML

2008-11-28 Thread Andrew Ballard
On Fri, Nov 28, 2008 at 5:45 AM, Ashley Sheridan [EMAIL PROTECTED] wrote: On Fri, 2008-11-28 at 10:15 +0100, Per Jessen wrote: Ashley Sheridan wrote: Do any of you have a copy of this extension, or failing that, a suggestion of how I can parse XML files without having to install anything

Re: [PHP] Parsing XML

2008-11-28 Thread Per Jessen
Andrew Ballard wrote: XSL will only allow me to convert it into a different document format, which is not what I want as I need to keep a local copy of information in a database for searching and sorting purposes. Nathans class allows me to have the entire document put into an array tree,

[PHP] Parsing XML

2008-11-27 Thread Ashley Sheridan
Hi All, I've run into a bit of a problem. I need to parse some fairly detailed XML files from a remote website. I'm pulling in the remote XML using curl, and that bit is working fine. The smaller XML documents were easy to parse with regular expressions, as I only needed bit of information out

[PHP] Parsing out excel's .xls textboxes?

2008-11-13 Thread Nitsan Bin-Nun
Hi, I have an excel parser I found out on the net a while ago. It does a really great job untill now. I need to parse out an excel file (.xls) with excel's textboxes in it, I want to fetch the textboxes content from the .xls somehow. I have no idea where to look out for this, I have even

Re: [PHP] Parsing out excel's .xls textboxes?

2008-11-13 Thread Ashley Sheridan
On Fri, 2008-11-14 at 00:45 +0200, Nitsan Bin-Nun wrote: Hi, I have an excel parser I found out on the net a while ago. It does a really great job untill now. I need to parse out an excel file (.xls) with excel's textboxes in it, I want to fetch the textboxes content from the .xls somehow.

Re: [PHP] Parsing out excel's .xls textboxes?

2008-11-13 Thread Nitsan Bin-Nun
It is binary file, saved from office 2003. There is no way of changing the office version (so I can save it as .xml of something) so I have to figure out how to parse these textboxes. Nitsan On 11/14/08, Ashley Sheridan [EMAIL PROTECTED] wrote: On Fri, 2008-11-14 at 00:45 +0200, Nitsan Bin-Nun

Re: [PHP] Parsing URLs

2008-10-28 Thread Yeti
One could also abuse basename and pathinfo. Works in PHP4+ ?php $uri = 'http://www.domain.com/page/file/'; $pathinfo = pathinfo($uri); $webpageaccess = array(); $webpageaccess[1] = $webpageaccess[2] = ''; if (isset($pathinfo['basename'])) $webpageaccess[1] = $pathinfo['basename']; if

[PHP] Parsing URLs

2008-10-27 Thread Ron Piggott
I would like to parse the URLs in the values after the domain name. The URLs are the results of mod re-write statements. Example 1: http://www.domain.com/page/file/ The desired results would be: $web_page_access[1] = file Example 2: http://www.domain.com/page/file/2/ The desired

Re: [PHP] Parsing URLs

2008-10-27 Thread Eric Butera
On Mon, Oct 27, 2008 at 10:04 PM, Ron Piggott [EMAIL PROTECTED] wrote: I would like to parse the URLs in the values after the domain name. The URLs are the results of mod re-write statements. Example 1: http://www.domain.com/page/file/ The desired results would be: $web_page_access[1] =

[PHP] parsing form with a website question...

2008-08-14 Thread bruce
Hi guys... Got a question that I figured I'd ask before I reinvent the wheel. A basic website has a form, or multiple forms. within the form, there might be multiple elements (lists/select statements, etc...). each item would have a varname, which would in turn be used as part of the form

Re: [PHP] parsing form with a website question...

2008-08-14 Thread Robert Cummings
On Thu, 2008-08-14 at 15:47 -0700, bruce wrote: Hi guys... Got a question that I figured I'd ask before I reinvent the wheel. A basic website has a form, or multiple forms. within the form, there might be multiple elements (lists/select statements, etc...). each item would have a

RE: [PHP] parsing form with a website question...

2008-08-14 Thread bruce
action... ain't life grand!! thanks... -Original Message- From: Robert Cummings [mailto:[EMAIL PROTECTED] Sent: Thursday, August 14, 2008 4:57 PM To: bruce Cc: php-general@lists.php.net Subject: Re: [PHP] parsing form with a website question... On Thu, 2008-08-14 at 15:47 -0700, bruce

Re: [PHP] parsing form with a website question...

2008-08-14 Thread tedd
At 7:57 PM -0400 8/14/08, Robert Cummings wrote: On Thu, 2008-08-14 at 15:47 -0700, bruce wrote: -snip- That's 100 billion bytes AKA 100 metric gigabytes... remember that was just 1 form. Cheers, Rob. Killjoy. :-) He could have had a lot of fun figuring that out. tedd -- ---

Re: [PHP] parsing form with a website question...

2008-08-14 Thread Chris
bruce wrote: rob, i'm fully aware of the issues, and for the targeted sites that i'm focusing on, i can employ strategies to prune the tree... but the overall issue is that i'm looking for a tool/app/process that does what i've described. the basic logic is that the app needs to use a config

Re: [PHP] parsing form with a website question...

2008-08-14 Thread Robert Cummings
On Thu, 2008-08-14 at 21:39 -0400, tedd wrote: At 7:57 PM -0400 8/14/08, Robert Cummings wrote: On Thu, 2008-08-14 at 15:47 -0700, bruce wrote: -snip- That's 100 billion bytes AKA 100 metric gigabytes... remember that was just 1 form. Cheers, Rob. Killjoy. :-) He could have had a

[PHP] parsing text for special characters

2007-11-29 Thread Adam Williams
I've got an html form, and I have PHP parse the message variables for special characters so when I concatenate all off the message variables together, if a person has put in a ' or other special character, it won't break it when it used in mail($to, MMH Suggestion, $message, $headers); below

Re: [PHP] parsing text for special characters

2007-11-29 Thread mike
On 11/29/07, Adam Williams [EMAIL PROTECTED] wrote: I've got an html form, and I have PHP parse the message variables for special characters so when I concatenate all off the message variables together, if a person has put in a ' or other special character, it won't break it when it used in

Re: [PHP] parsing text for special characters

2007-11-29 Thread Jochem Maas
Adam Williams wrote: I've got an html form, and I have PHP parse the message variables for special characters so when I concatenate all off the message variables together, if a person has put in a ' or other special character, it exactly how are ' and special inside the body of an email

[PHP] Parsing XML with DTD

2007-11-22 Thread Skip Evans
Hey all, I've been asked if it's possible to parse XML files given a DTD file that describes the elements within it, so I've been looking through the docs at php.net. So far I've found this: http://us.php.net/manual/en/ref.xml.php Which has some samples on, but nothing that I see will

Re: [PHP] Parsing XML with DTD

2007-11-22 Thread Skip Evans
Hey Jochem all, Thanks much for this tip. I will check it out. A little further reading looks like PEAR provides some XML and DTD capabilities? Anyone have any experience with this? Also, the reason I asked about the DTD is that these XML files are really extensive, providing lots of

  1   2   3   4   5   6   7   >