Adding comments to a multiline echo.
Posted: Sat Nov 27, 2004 7:15 pm
I assume it's not possible, but you never know until you're sure...
Would come handy sometimes....
Would come handy sometimes....
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
<?php
//it is possible... notice how this is doing it
?>Code: Select all
<?php
echo "Hello " . // Hello
"World"; // World
?>This'll do great, thanks once again matesredmonkey wrote:I assume you mean something like....In which case, yes it is possible.Code: Select all
<?php echo "Hello " . // Hello "World"; // World ?>
Code: Select all
// comments for foo1
$text .= "foo1"
// comments for foo2
$text .= "foo2"
...
echo $text;Code: Select all
<?php
$unpack = 'vversion/' // version made by (2 bytes)
. 'vextract_version/' // version needed to extract (2 bytes)
. 'vgp_bit/' // general purpose bit (2 bytes)
. 'vmethod/' // compression method (2 bytes)
. 'Vmod_time/' // last modified time and date (4 bytes)
. 'Vcrc32/' // crc32 (4 bytes)
. 'Vc_len/' // compressed length (4 bytes)
. 'Vuc_len/' // uncompressed length (4 bytes)
. 'vfn_len/' // length of filename (2 bytes)
. 'vef_len/' // extra field length (2 bytes)
. 'vfcom_len/' // file comment length (2 bytes)
. 'vdisk_start/' // disk number start (2 bytes)
. 'vin_fa/' // internal file attributes (2 bytes)
. 'Vex_fa/' // external file sttributes (4 bytes)
. 'Voffset'; // relative offset of local header (4 bytes)
?>Code: Select all
<?php
// version made by (2 bytes)
$unpack = 'vversion/';
// version needed to extract (2 bytes)
$unpack .= 'vextract_version/';
// general purpose bit (2 bytes)
$unpack .= 'vgp_bit/';
// compression method (2 bytes)
$unpack .= 'vmethod/';
// last modified time and date (4 bytes)
$unpack .= 'Vmod_time/';
// crc32 (4 bytes)
$unpack .= 'Vcrc32/';
// compressed length (4 bytes)
$unpack .= 'Vc_len/';
// uncompressed length (4 bytes)
$unpack .= 'Vuc_len/';
// length of filename (2 bytes)
$unpack .= 'vfn_len/';
// extra field length (2 bytes)
$unpack .= 'vef_len/';
// file comment length (2 bytes)
$unpack .= 'vfcom_len/';
// disk number start (2 bytes)
$unpack .= 'vdisk_start/';
// internal file attributes (2 bytes)
$unpack .= 'vin_fa/';
// external file sttributes (4 bytes)
$unpack .= 'Vex_fa/';
// relative offset of local header (4 bytes)
$unpack .= 'Voffset';
?>