php-general Digest 29 Sep 2010 13:01:53 -0000 Issue 6965

2010-09-29 Thread php-general-digest-help

php-general Digest 29 Sep 2010 13:01:53 - Issue 6965

Topics (messages 308348 through 308352):

Re: SimpleXML/array duality (like particles  waves)
308348 by: Nathan Nobbe
308349 by: Brian Dunning
308350 by: Nathan Nobbe
308352 by: Erik L. Arneson

Re: if/elseif being treated as if/if
308351 by: Neville Dempsey

Administrivia:

To subscribe to the digest, e-mail:
php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
php-gene...@lists.php.net


--
---BeginMessage---
On Tue, Sep 28, 2010 at 4:29 PM, Brian Dunning br...@briandunning.comwrote:

 I am kind of jacked here. I have a SimpleXML object that's been converted
 to an array.


how was the SimpleXMLElement converted to an array?

-nathan
---End Message---
---BeginMessage---
If you read down to the bottom of the post, the function I used is given.


On Sep 28, 2010, at 3:47 PM, Nathan Nobbe wrote:

 On Tue, Sep 28, 2010 at 4:29 PM, Brian Dunning br...@briandunning.com wrote:
 I am kind of jacked here. I have a SimpleXML object that's been converted to 
 an array.
 
 how was the SimpleXMLElement converted to an array?
 
 -nathan 

---End Message---
---BeginMessage---
On Tue, Sep 28, 2010 at 5:06 PM, Brian Dunning br...@briandunning.comwrote:

 If you read down to the bottom of the post, the function I used is given.


My apologies for the hasty response.  well, if i had to guess, id say thats
where the problem is.  why cant you just iterate over the object w/ the
built in functionality, which is to say, why bother converting to an array
in the first place?

-nathan
---End Message---
---BeginMessage---
On Tue, 28 Sep 2010, Brian Dunning wrote:
 I am kind of jacked here. I have a SimpleXML object that's been
 converted to an array. In one of the nodes, for no reason I can see,
 the array is populated differently if there is only one order_item
 than if there are multiple order_items.

 [...]

 In case it matters, here is that snip of what the original XML looks
 like, it's all good: 
 ?xml version=1.0 encoding=UTF-8?
 order xmlns=http://.com/; version=1.0
   order_items
 order_item
   order_item_product_code finish=glossy1060/order_item_product_code
   order_item_description4x5.3 trueDigital 
 print(s)/order_item_description
 /order_item
 order_item
   order_item_product_code finish=glossy1300/order_item_product_code
   order_item_description4x8 photo cards (set of 
 20)/order_item_description
 /order_item
   /order_items
 /order

What does the XML look like if there's only one order item?  Maybe
you're losing a level of nesting there?

-- 
Erik Arneson dyb...@lnouv.com
  GPG Key ID : 1024D/62DA1D25   BitCoin : 1LqvuGUqJ4ZUSoE7YE9ngETjwp4yZ2uSdP
  Office : +1.541.291.9776Skype : callto://pymander
http://www.leisurenouveau.com/

---End Message---
---BeginMessage---
On Tue, Mon Sep 27 06:48:43 2010, Ford, Mike wrote:
  -Original Message-
  From: tedd [mailto:tedd.sperl...@gmail.com]
  Sent: 25 September 2010 16:02
 
  
  One can make the argument that the ELSE IF statement first surfaced
  circa 1977 in FORTRAN 77 and the CASE statement came later in
  FORTRAN
  90 circa 1991.
 
 Being a fully-fledged member of the pedants' society, I can't let that
 go without comment.
 
 Those dates only hold if you stick to FORTRAN. Algol-68 had
 if-elif-else-fi, and I don't believe it was a pioneer in the structure
 even then (although the syntax may have been novel). It also had a
 case-esac structure. I'd say both elseif and case/switch developed in
 other languages and were adopted into FORTRAN long after they were
 established as bona fide programming constructs.

In Algol 68 rev0 had the longer conditional clause:
* IF ~ THEN ~ ELSF ~ THEN ~ ELSE ~ FI
Subsequently - in rev1- this was dropped in favour of:
* IF ~ THEN ~ ELIF ~ THEN ~ ELSE ~ FI

Or...
brief form: 
 ( condition1 | statements |: condition2 | statements | statements )

Pdf - AB36.3.1 FINAL REPORT ON IMPROVEMENTS TO ALGOL 68
c.f. http://portal.acm.org/citation.cfm?id=1061641 (registration required)

 C 55  (representations)
   Some further small changes:
   elif is now used in place of elsf , (on a bad lineprinter , ELSE was too
   difficult to distinguish from ELSE)

The ALGOL 68 page on wikipedia details the ALGOL 68 conditional clause
in German:

 # Nachfolgetag - Deutsche Variante #
  menge datum = tupel(ganz tag, wort monat, ganz Jahr);
  funktion naechster tag nach = (datum x) datum:
   wenn tag von x  monatslaenge(monat von x, jahr von x)
   dann (tag von x + 1, monat von x, jahr von x)
   wennaber monat von x = Dezember
   dann (1, Januar, jahr von x + 1)
   ansonsten (1, nachfolgemonat(monat von x), jahr von x)
   endewenn;  
Note 

[PHP] Re: SimpleXML/array duality (like particles waves)

2010-09-29 Thread Erik L. Arneson
On Tue, 28 Sep 2010, Brian Dunning wrote:
 I am kind of jacked here. I have a SimpleXML object that's been
 converted to an array. In one of the nodes, for no reason I can see,
 the array is populated differently if there is only one order_item
 than if there are multiple order_items.

 [...]

 In case it matters, here is that snip of what the original XML looks
 like, it's all good: 
 ?xml version=1.0 encoding=UTF-8?
 order xmlns=http://.com/; version=1.0
   order_items
 order_item
   order_item_product_code finish=glossy1060/order_item_product_code
   order_item_description4x5.3 trueDigital 
 print(s)/order_item_description
 /order_item
 order_item
   order_item_product_code finish=glossy1300/order_item_product_code
   order_item_description4x8 photo cards (set of 
 20)/order_item_description
 /order_item
   /order_items
 /order

What does the XML look like if there's only one order item?  Maybe
you're losing a level of nesting there?

-- 
Erik Arneson dyb...@lnouv.com
  GPG Key ID : 1024D/62DA1D25   BitCoin : 1LqvuGUqJ4ZUSoE7YE9ngETjwp4yZ2uSdP
  Office : +1.541.291.9776Skype : callto://pymander
http://www.leisurenouveau.com/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] reporting spam in PHP manual?

2010-09-29 Thread MikeB

Came across this entry as a user comment in the php.net manual.

http://www.php.net/manual/en/language.exceptions.php#100089

Couldn't see how to report it so it could be removed.

Maybe someone that knows how can tell me, or report it themselves?

Thanks,


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] reporting spam in PHP manual?

2010-09-29 Thread Daniel P. Brown
On Wed, Sep 29, 2010 at 12:12, MikeB mpbr...@gmail.com wrote:
 Came across this entry as a user comment in the php.net manual.

 http://www.php.net/manual/en/language.exceptions.php#100089

 Couldn't see how to report it so it could be removed.

 Maybe someone that knows how can tell me, or report it themselves?

I was just getting ready to do it, but Richard Quadling beat me to
the punch.  Thanks for pointing it out though, Mike.

-- 
/Daniel P. Brown
Dedicated Servers, Cloud and Cloud Hybrid Solutions, VPS, Hosting
(866-) 725-4321
http://www.parasane.net/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Which PHP 5.3 documentation generators have you found?

2010-09-29 Thread Adam Richardson
Hi all,

Anybody know of a documentation generator which plays nicely with PHP 5.3?

Thanks,

Adam

-- 
Nephtali:  PHP web framework that functions beautifully
http://nephtaliproject.com


Re: [PHP] Which PHP 5.3 documentation generators have you found?

2010-09-29 Thread a...@ashleysheridan.co.uk
Does phpDocumenter not do the trick? I must admit, I've not tried anything 
specific to 5.3 (i can imagine the namespace thing would be a major part if the 
documentation) but its served me well with other php5 code.

Thanks,
Ash
http://www.ashleysheridan.co.uk

- Reply message -
From: Adam Richardson simples...@gmail.com
Date: Wed, Sep 29, 2010 19:36
Subject: [PHP] Which PHP 5.3 documentation generators have you found?
To: PHP-General php-general@lists.php.net

Hi all,

Anybody know of a documentation generator which plays nicely with PHP 5.3?

Thanks,

Adam

-- 
Nephtali:  PHP web framework that functions beautifully
http://nephtaliproject.com


Re: [PHP] Which PHP 5.3 documentation generators have you found?

2010-09-29 Thread Adam Richardson
On Wed, Sep 29, 2010 at 2:54 PM, a...@ashleysheridan.co.uk 
a...@ashleysheridan.co.uk wrote:

 Does phpDocumenter not do the trick? I must admit, I've not tried anything
 specific to 5.3 (i can imagine the namespace thing would be a major part if
 the documentation) but its served me well with other php5 code.



In the past I've been really pleased using phpDocumentor, however I'm afraid
the namespaces in 5.3 cause it to choke :(

Adam

-- 
Nephtali:  PHP web framework that functions beautifully
http://nephtaliproject.com


[PHP] converting a mysql date value

2010-09-29 Thread David Mehler
Hello,
I've got dates stored in a mysql database. The field is of type date
so the value is something like: 2010-09-29 I'm wanting to display
them as in U.S. dates as in month, day, year. I had a function that
did this, now it is not working and I am perplexed as to why. Here's
my echo statement:

?php echo sqlDateFormat($row['date']); ?

The $row['date'] is coming out of the mysql database. Here's the
sqlDateFormat function:

function sqlDateFormat($value) {
$date = $value;
$date = strtotime($date);
$date = date('m-d-y', $date);
return $date;
}

I'd appreciate any suggestions as to why this isn't working.
Thanks.
Dave.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] converting a mysql date value

2010-09-29 Thread Adam Richardson
On Wed, Sep 29, 2010 at 3:11 PM, David Mehler dave.meh...@gmail.com wrote:

 Hello,
 I've got dates stored in a mysql database. The field is of type date
 so the value is something like: 2010-09-29 I'm wanting to display
 them as in U.S. dates as in month, day, year. I had a function that
 did this, now it is not working and I am perplexed as to why. Here's
 my echo statement:

 ?php echo sqlDateFormat($row['date']); ?

 The $row['date'] is coming out of the mysql database. Here's the
 sqlDateFormat function:

 function sqlDateFormat($value) {
 $date = $value;
 $date = strtotime($date);
 $date = date('m-d-y', $date);
 return $date;
 }

 I'd appreciate any suggestions as to why this isn't working.
 Thanks.
 Dave.

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


What's being echoed out?

Adam

-- 
Nephtali:  PHP web framework that functions beautifully
http://nephtaliproject.com


Re: [PHP] converting a mysql date value

2010-09-29 Thread Steve Staples
http://www.w3schools.com/sql/func_date_format.asp

when you do your select,  SELECT DATE_FORMAT(`field_name`,'%b %d %Y %h:
%i %p') AS 'field_name'

which would yield you the field field_name:
'Nov 04 2008 11:45 PM'

would be easier to do it there, rather than in your PHP... and you can
change the date_format in your query via PHP if you need to change it on
the fly... 

if the dates were in UNIX TIME, you can do it like:
SELECT DATE_FORMAT(FROM_UNIXTIME(`field_name_in_unix_timestamp`),'%b %d
%Y %h:%i %p');


Steve

On Wed, 2010-09-29 at 15:11 -0400, David Mehler wrote:
 Hello,
 I've got dates stored in a mysql database. The field is of type date
 so the value is something like: 2010-09-29 I'm wanting to display
 them as in U.S. dates as in month, day, year. I had a function that
 did this, now it is not working and I am perplexed as to why. Here's
 my echo statement:
 
 ?php echo sqlDateFormat($row['date']); ?
 
 The $row['date'] is coming out of the mysql database. Here's the
 sqlDateFormat function:
 
 function sqlDateFormat($value) {
 $date = $value;
 $date = strtotime($date);
 $date = date('m-d-y', $date);
 return $date;
 }
 
 I'd appreciate any suggestions as to why this isn't working.
 Thanks.
 Dave.
 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RES: [PHP] converting a mysql date value

2010-09-29 Thread Alejandro Michelin Salomon
David :

Try this :

$a = explode('-', '2010-01-23');
$b = array( $a[1], $a[2], $a[0] );

echo implode( '/', $b);

// 01/23/2010 

Alejandro M.S.

-Mensagem original-
De: David Mehler [mailto:dave.meh...@gmail.com] 
Enviada em: quarta-feira, 29 de setembro de 2010 16:12
Para: php-general
Assunto: [PHP] converting a mysql date value

Hello,
I've got dates stored in a mysql database. The field is of type date
so the value is something like: 2010-09-29 I'm wanting to display
them as in U.S. dates as in month, day, year. I had a function that
did this, now it is not working and I am perplexed as to why. Here's
my echo statement:

?php echo sqlDateFormat($row['date']); ?

The $row['date'] is coming out of the mysql database. Here's the
sqlDateFormat function:

function sqlDateFormat($value) {
$date = $value;
$date = strtotime($date);
$date = date('m-d-y', $date);
return $date;
}

I'd appreciate any suggestions as to why this isn't working.
Thanks.
Dave.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP Email Question

2010-09-29 Thread Joe Jackson
Hi

I am trying the following snippet as Bostjan  suggested, and an email is
getting sent when I submit the form however in the body of the email I am
getting none of the form data in the body of the email.  All I am getting is
the letter 'z' ?  Also in the from field of the email this is showing as my
email address and not the email address of the user who has sent the form

Any ideas on where I am going wrong with this snippet?  Any advice would be
much appreciated


$msgContent = Name: . $values['name'] .\n;
$msgContent .= Address: . $values['address'] .\n;
$msgContent .= Telephone: . $values['telephone'] .\n;
$msgContent .= Email Address: . $values['emailaddress'] .\n;
$msgContent .= Message: . $values['message'] .\n;

function ProcessForm($values)
{
mail('myemail:domain.com', 'Website Enquiry', $msgContent, From:
\{$values['name']}\ {$values['emailaddress']});

 // Replace with actual page or redirect :P
echo htmlheadtitleThank you!/title/headbodyThank
you!/body/html;


[PHP] Open Source Website Flowchart and Wireframe Software?

2010-09-29 Thread Daniel Kolbo
Hello,

This is not strictly a PHP question, though i do think some members that
subscribe to this list might be able to answer this question.

Is there an open source website flowchart and wireframe software.  My
google searches are not quite pulling up what I'm looking for.

I would like a piece of software that let's me layout the wireframes for
various pages of a site.  I would like to create a unique number for
each page.  On each wireframe, next to the links on that page, I would
like to reference the destination of that link by the unique number of
the page to which it is directed.  When I'm all done with the
wireframes, I would like the software to create a flowchart for the site.

Other than the above, I'm looking for a very simple piece of software.
Any ideas?

Thanks in advance,
dK
`

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php