php-general Digest 7 Apr 2011 16:42:06 -0000 Issue 7262
Topics (messages 312289 through 312305):
Re: the best 1 book for php
312289 by: Michael Shadle
312290 by: Jim Lucas
312291 by: Adam Richardson
312294 by: Richard Quadling
312297 by: Andre Polykanine
312298 by: Andy McKenzie
312299 by: tedd
312300 by: Richard Quadling
312301 by: Richard Quadling
312302 by: Jay Blanchard
312303 by: Marc Guay
312304 by: Yousif Masoud
312305 by: Negin Nickparsa
Re: File Upload Problem
312292 by: Wojciech Kupiec
Re: Ranges for case statement and a WTF moment.
312293 by: Richard Quadling
312295 by: Ford, Mike
312296 by: Richard Quadling
Administrivia:
To subscribe to the digest, e-mail:
[email protected]
To unsubscribe from the digest, e-mail:
[email protected]
To post to the list, e-mail:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
http://www.php.net/
On Wed, Apr 6, 2011 at 9:15 PM, Kirk Bailey <[email protected]> wrote:
> If I only had 1 book on php, what would it be?
>
> --
> end
>
> Very Truly yours,
> - Kirk Bailey,
> Largo Florida
>
> kniht
> +-----+
> | BOX |
> +-----+
> think
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
+1
1. Always current
2. Usable & evolving examples
On 4/6/2011 9:23 PM, Michael Shadle wrote:
http://www.php.net/
On Wed, Apr 6, 2011 at 9:15 PM, Kirk Bailey<[email protected]> wrote:
If I only had 1 book on php, what would it be?
--
end
Very Truly yours,
- Kirk Bailey,
Largo Florida
kniht
+-----+
| BOX |
+-----+
think
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
Jim Lucas
www.cmsws.com
--- End Message ---
--- Begin Message ---
On Thu, Apr 7, 2011 at 12:15 AM, Kirk Bailey <[email protected]>wrote:
> If I only had 1 book on php, what would it be?
>
> --
> end
>
> Very Truly yours,
> - Kirk Bailey,
> Largo Florida
>
> kniht
> +-----+
> | BOX |
> +-----+
> think
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
This is going to sound a little silly, but I'm going to say [drumroll...]
K & R (The C Programming Language)
Let me explain. I've recently reread (most of it anyway) K & R, and the
whole time I was reading I felt like I was studying up on PHP just as much
as C.
There's no language that played a bigger role in the design decisions, and
this is clearly evident when you listen to the core developers. In fact,
even this past week Rasmus said on the PHP Dev list, "Argh! Everyone should
be forced to learn a bit of C. Like many PHP functions, the name and
argument order is right out of libc", a sentiment he's expressed before.
I must admit that I tend to think of PHP as C code that includes garbage
collection of lots of very practical web goodies. And, the book itself is a
gem in terms of clarity, brevity, and sage advice.
So, read (or read again for the umpteenth time) K & R, and then fill in the
gaps with PHP.net. And, on the rare occasion you would need more speed than
your PHP script is providing, you'll be able to write you're own extension
to PHP using it's older brother, C.
Adam
--
Nephtali: A simple, flexible, fast, and security-focused PHP framework
http://nephtaliproject.com
--- End Message ---
--- Begin Message ---
On 7 April 2011 05:15, Kirk Bailey <[email protected]> wrote:
> If I only had 1 book on php, what would it be?
I wouldn't. Not a book JUST on PHP.
The book which I'm actually enjoying the most is "Code Complete" by
Steve McConnell. It is subtitled "A Practical Handbook of Software
Construction".
I am a self taught developer. As such, I missed out on a lot of the
"best practise" methodologies that have been proven to assist in
helping a developer play well with others.
The book covers no particular language, but gives you an understanding
on how to write software.
A second edition is now available - http://www.cc2e.com /
http://onlinepriceguide.co.uk/v2/book_comparison.php?code=0735619670&title=Code+Complete&author=Steven+C+McConnell
(for a UK price comparison list).
Richard.
--
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY
--- End Message ---
--- Begin Message ---
Hello Kirk,
Php manual from php.net :-).
--
With best regards from Ukraine,
Andre
Skype: Francophile
My blog: http://oire.org/menelion (mostly in Russian)
Twitter: http://twitter.com/m_elensule
Facebook: http://facebook.com/menelion
------------ Original message ------------
From: Kirk Bailey <[email protected]>
To: PHP General
Date created: , 7:15:40 AM
Subject: [PHP] the best 1 book for php
If I only had 1 book on php, what would it be?
--
end
Very Truly yours,
- Kirk Bailey,
Largo Florida
kniht
+-----+
| BOX |
+-----+
think
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
On Thu, Apr 7, 2011 at 12:15 AM, Kirk Bailey <[email protected]> wrote:
> If I only had 1 book on php, what would it be?
>
> --
> end
>
> Very Truly yours,
> - Kirk Bailey,
> Largo Florida
>
My most common reference is, as other people have said, www.php.net.
But when I reach for a paper book for some reason, it's usually
because I can't remember something really basic, and I reach for
Beginning PHP4 from WROX press. It's out of date, but the concepts
are still right, and the basic stuff still works the same way. I
haven't bought the newer Beginning PHP5 yet, but if I were going to
buy just one, it would probably be that.
-Alex
--- End Message ---
--- Begin Message ---
At 12:15 AM -0400 4/7/11, Kirk Bailey wrote:
If I only had 1 book on php, what would it be?
The Bible.
Cheers,
tedd
--
-------
http://sperling.com/
--- End Message ---
--- Begin Message ---
On 7 April 2011 13:51, Andy McKenzie <[email protected]> wrote:
> On Thu, Apr 7, 2011 at 12:15 AM, Kirk Bailey <[email protected]> wrote:
>> If I only had 1 book on php, what would it be?
>>
>> --
>> end
>>
>> Very Truly yours,
>> - Kirk Bailey,
>> Largo Florida
>>
>
> My most common reference is, as other people have said, www.php.net.
> But when I reach for a paper book for some reason, it's usually
> because I can't remember something really basic, and I reach for
> Beginning PHP4 from WROX press. It's out of date, but the concepts
> are still right, and the basic stuff still works the same way. I
> haven't bought the newer Beginning PHP5 yet, but if I were going to
> buy just one, it would probably be that.
>
> -Alex
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
If you are on Windows or have a CHM viewer, then the offline manuals
available from http://www.php.net/download-docs.php are as good as a
book as it gets.
There is a version of PhD ready to roll which produces the CHM files
with the user notes embedded, so you can get the whole kablooey in 1
go.
Richard.
--
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY
--- End Message ---
--- Begin Message ---
On 7 April 2011 14:41, tedd <[email protected]> wrote:
> At 12:15 AM -0400 4/7/11, Kirk Bailey wrote:
>>
>> If I only had 1 book on php, what would it be?
>>
>
> The Bible.
I've reliably informed that many people believe the bible covers such
things as the beginning of the universe, the dawn of man and aliens,
but PHP? That's a new one.
--
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY
--- End Message ---
--- Begin Message ---
[snip]
I've reliably informed that many people believe the bible covers such
things as the beginning of the universe, the dawn of man and aliens,
but PHP? That's a new one.
[/snip]
I think it is in the Psalms somewhere.
--- End Message ---
--- Begin Message ---
session_start(); // genesis
// do stuff
session_destroy(); // revelation
--- End Message ---
--- Begin Message ---
On Thu, 2011-04-07 at 00:15 -0400, Kirk Bailey wrote:
> If I only had 1 book on php, what would it be?
>
> --
> end
>
> Very Truly yours,
> - Kirk Bailey,
> Largo Florida
>
> kniht
> +-----+
> | BOX |
> +-----+
> think
>
>
The best answer I can think to your question is: "It depends".
That said, can I suggest "PHP in Action" by Reiersol, Baker and Shiflett
I believe it covers a good variety of topics.
http://books.google.com/books?id=8TnUOQAACAAJ&dq=PHP+in
+action&hl=en&src=bmrr&ei=6cmdTY7eD8Gk8QOyufm2BA&sa=X&oi=book_result&ct=result&resnum=1&ved=0CCgQ6AEwAA
--- End Message ---
--- Begin Message ---
introduction 2 PHP and MySql,Larry ullman
--- End Message ---
--- Begin Message ---
On 06/04/11 19:10, tedd wrote:
Hi gang:
I wrote a simple script to upload image files from my desktop to a
server -- the exact same code works on two servers, but fails on a third.
I suspect there is something set different between the servers, but I
can't find it.
Oddly enough, I can upload image files directly to the database, but not
to the file system.
What could be wrong? What should I be looking for?
The simplest explanation is that you don't have write permissions to the
location where you upload the file or to the temp directory.
If you really want to get help, publish your code.
--- End Message ---
--- Begin Message ---
On 6 April 2011 21:08, David Harkness <[email protected]> wrote:
> On Tue, Apr 5, 2011 at 8:28 AM, Richard Quadling <[email protected]>
> wrote:
>>
>> php -r "var_dump(10...19);"
>>
>> Interesting output ...
>>
>> string(6) "100.19"
>>
>> And that took me a little while to work out.
>>
>> It's all to do with PHP's type juggling.
>>
>> 10...19
>>
>> What I'm not sure is why the middle empty string is output as 0.
>>
>> "10" . . ".19" becomes "10" . "0" . ".19" which becomes "100.19"
>
> My guess is that PHP parses this as
> 10<decimal-point> <dot-operator> <decimal-point>19
> Because the dot operator requires strings, PHP converts both numbers to
> strings as
> '10' <dot-operator> '0.19'
> which becomes your
> 100.19
> You can see this with
> php > echo (string) 10.
> 10
> php > echo (string) .19
> 0.19
> David
>
Aha! Yes. That makes a LOT more sense.
Excellent deduction.
So. Not a bug at all. Just a really weird sequence.
And obviously, spaces and more dots can't work.
Richard.
--
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY
--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: David Harkness [mailto:[email protected]]
> Sent: 06 April 2011 21:08
> To: Richard Quadling; PHP General list
> Subject: Re: [PHP] Ranges for case statement and a WTF moment.
>
> On Tue, Apr 5, 2011 at 8:28 AM, Richard Quadling
> <[email protected]>wrote:
>
[...]
> > 10...19
> >
> > What I'm not sure is why the middle empty string is output as 0.
> >
> > "10" . . ".19" becomes "10" . "0" . ".19" which becomes "100.19"
> >
>
> My guess is that PHP parses this as
>
> 10<decimal-point> <dot-operator> <decimal-point>19
>
> Because the dot operator requires strings, PHP converts both numbers
> to
> strings as
>
> '10' <dot-operator> '0.19'
>
> which becomes your
>
> 100.19
>
> You can see this with
>
> php > echo (string) 10.
> 10
> php > echo (string) .19
> 0.19
Oh, excellent deduction! I must admit, my first instinct was also that
both numbers should absorb a dot if one of them did, but failed to
realise that .19 would be coerced to "0.19". Just shows how you really
have to think things through, sometimes!
Cheers!
Mike
--
Mike Ford,
Electronic Information Developer, Libraries and Learning Innovation,
Leeds Metropolitan University, C507 City Campus,
Woodhouse Lane, LEEDS, LS1 3HE, United Kingdom
Email: [email protected]
Tel: +44 113 812 4730
To view the terms under which this email is distributed, please go to
http://disclaimer.leedsmet.ac.uk/email.htm
--- End Message ---
--- Begin Message ---
And all this is shown when you ...
php -r "print_r(array_map(function(&$token){if(is_array($token)){$token[0]
= token_name($token[0]);} return $token;},token_get_all('<?php echo
10...19;')));"
Array
(
[0] => Array
(
[0] => T_OPEN_TAG
[1] => <?php
[2] => 1
)
[1] => Array
(
[0] => T_ECHO
[1] => echo
[2] => 1
)
[2] => Array
(
[0] => T_WHITESPACE
[1] =>
[2] => 1
)
[3] => Array
(
[0] => T_DNUMBER
[1] => 10.
[2] => 1
)
[4] => .
[5] => Array
(
[0] => T_DNUMBER
[1] => .19
[2] => 1
)
[6] => ;
)
--
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY
--- End Message ---