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
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
The XML functions really aren't that hard to use. If you just want a
simple parse to pick out something have a look at:
for PHP4: http://php.net/xml_parse_into_struct
for PHP5: http://php.net/simplexml_load_file
-Rasmus
[EMAIL PROTECTED] wrote:
you can handle xml output as if a string file, then
you can handle xml output as if a string file, then easily parse xml file
with preg_match / preg_match_all,
smt like this can do the job:
$str="somevalueheresomevaluehere2somevaluehere2etc";
preg_match_all("/([^<])*<\/price>/i", $str, $matches);
echo count($matches[0]);
for ($i=0; $i< count($ma
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.
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
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
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
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
9 matches
Mail list logo