Re: [PHP] Easy way to grab a value out of XML?

2005-04-05 Thread Richard Lynch
On Fri, April 1, 2005 1:53 pm, Brian Dunning said: > I've been looking at the XML commands and am feeling a bit overwhelmed. > My needs are simple and I'm hoping there's an easy solution that I'm > just missing. I have a hunk of well-formed XML in a variable, $xml, and > it contains only one instan

Re: [PHP] Easy way to grab a value out of XML?

2005-04-02 Thread Burhan Khalid
Brian Dunning wrote: I've been looking at the XML commands and am feeling a bit overwhelmed. My needs are simple and I'm hoping there's an easy solution that I'm just missing. I have a hunk of well-formed XML in a variable, $xml, and it contains only one instance of x.xx. I just want to get the

Re: [PHP] Easy way to grab a value out of XML?

2005-04-01 Thread Rasmus Lerdorf
]); $i++) { echo ' + '.$matches[0][$i]; } ?> but you'd better learn to handle xml files via xml parsers. - Original Message - From: "Brian Dunning" <[EMAIL PROTECTED]> To: Sent: Friday, April 01, 2005 11:53 PM Subject: [PHP] Easy way to grab a value

Re: [PHP] Easy way to grab a value out of XML?

2005-04-01 Thread emre
hes[0]); for ($i=0; $i< count($matches[0]); $i++) { echo ' + '.$matches[0][$i]; } ?> but you'd better learn to handle xml files via xml parsers. - Original Message - From: "Brian Dunning" <[EMAIL PROTECTED]> To: Sent: Friday, April 01, 2005 11:53

Re: [PHP] Easy way to grab a value out of XML?

2005-04-01 Thread Franklin van de Meent
If you are using PHP5 check out SimpleXML (http://php.net/simplexml) On Apr 1, 2005 10:53 PM, Brian Dunning <[EMAIL PROTECTED]> wrote: > I've been looking at the XML commands and am feeling a bit overwhelmed. > My needs are simple and I'm hoping there's an easy solution that I'm > just missing.

[PHP] Easy way to grab a value out of XML?

2005-04-01 Thread Brian Dunning
I've been looking at the XML commands and am feeling a bit overwhelmed. My needs are simple and I'm hoping there's an easy solution that I'm just missing. I have a hunk of well-formed XML in a variable, $xml, and it contains only one instance of x.xx. I just want to get the $price out of $xml.

Re: [PHP] Easy Way.

2003-03-09 Thread Chris Hayes
At 22:23 9-3-2003, you wrote: You're looking for the str_pad function. http://www.php.net/str_pad $i = 3; $i = str_pad($i, 5, '0', STR_PAD_LEFT); echo $i; // outputs '3' Just keep in mind that it won't help you if your input is greater than 5 to begin with, you'll have to check that seperately

Re: [PHP] Easy Way.

2003-03-09 Thread Vincent M.
Jason Sheets wrote: Hello, Use str_pad, the manual page is available at http://www.php.net/str_pad, a short example would be: $i = 3; $i = str_pad($i, 5, "0", STR_PAD_LEFT); This function is described in the PHP manual in the string functions section, the manual is an excellent place to go first w

Re: [PHP] Easy Way.

2003-03-09 Thread Mark Heintz PHP Mailing Lists
You're looking for the str_pad function. http://www.php.net/str_pad $i = 3; $i = str_pad($i, 5, '0', STR_PAD_LEFT); echo $i; // outputs '3' Just keep in mind that it won't help you if your input is greater than 5 to begin with, you'll have to check that seperately. $j = 123456; $j = str_pad

Re: [PHP] Easy Way.

2003-03-09 Thread Jason Sheets
Hello, Use str_pad, the manual page is available at http://www.php.net/str_pad, a short example would be: $i = 3; $i = str_pad($i, 5, "0", STR_PAD_LEFT); This function is described in the PHP manual in the string functions section, the manual is an excellent place to go first when questions such

[PHP] Easy Way.

2003-03-09 Thread Vincent M.
Hello, Is there an easy way to change an integer to a 5 caracters string. For example: $i = 3 ; $j = 110 ; After having changed them: $i = "3" ; $j = "00110" ; Is there a php function to do so instead of doing this: if( ($i>0)&&($i<10)) { $i = "".$i ; } else if( ($i>9)&