php-general Digest 8 Apr 2012 03:36:04 -0000 Issue 7765
Topics (messages 317482 through 317483):
Re: Watch out for automatic type casting
317482 by: Maciek Sokolewicz
image inventoryer
317483 by: Kirk Bailey
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
----------------------------------------------------------------------
--- Begin Message ---
On 07-04-2012 16:37, Bogdan Ribic wrote:
This is *not* typecasting at all, this is assignment of a result of
boolean operator, and it boils down to operator precedence.
It's equivalent to this code:
$b = $x == 11;
in the part that right side of equation sign is calculated first, then
assigned to lvalue. In effect, you wrote this:
$pos = (strpos($sText, "test") !== FALSE);
You would often use something like this in code:
$isSame = $x == $y;
which would put a boolean into $isSame, not put value of $x and then
compare it.
Bogdan,
you are reviving a thread over a week old, and repeating what 4 other
people have already stated. Please don't do that, it just results in
mailinglist-noise.
- Tul
--- End Message ---
--- Begin Message ---
<html>
<head>
<title>Image inventory of this directory</title>
<style TYPE="text/css">
body { margin-left: 10; margin-right: 10%; }
body {background-attachment:fixed;}
A:link, A:visited, A:active { text-decoration:none; }
A:hover { text-decoration:underline; }
.justify{text-align:justify;}
.center{text-align:center;}
</style>
</head>
<body bgcolor="#A0A0A0" TEXT="BLACK" LINKS="BLUE">
<CENTER>This page inventories the contents of this directory and
lists all image files in order- as
the computer determines such matters. Here is the full inventory.
<hr align="center">
<P>
<?php
foreach (glob("*.*") as $filename) {
echo '<img src="'.$filename.'">'."<br>\n$filename\n<P>\n";
}
?>
</body></html>
This works nicely. copied code from online manual, chainsaw editing
to fit, superglue in the spare parts needed and it lists them all
and composes proper img links to display on the inventory page. NOW
I have the tool i needed; can someone else put this to good work?
--
end
Very Truly yours,
- Kirk Bailey,
Largo Florida
kniht
+-----+
| BOX |
+-----+
think
--- End Message ---