php-general Digest 1 Mar 2011 03:07:53 -0000 Issue 7204
Topics (messages 311591 through 311596):
Re: Quotes in Heredoc
311591 by: tedd
311592 by: Colin Guthrie
311594 by: Bob McConnell
Figuring out file-encoding
311593 by: Asmann, Roland
311595 by: Jeffrin Jose
very quick Regex query
311596 by: Alexis
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 ---
At 8:23 AM -0500 2/28/11, Bob McConnell wrote:
From: Ashim Kapoor
From Ashley Sheridan
The quotes you mention are in the HTML, nothing to do with PHP. HTML
will
work without the quotes in most cases (unless there's a space in the
value
for the attribute) but the quotes are required in XHTML and will
cause
unexpected results.
Can you elaborate on the XHTML part? Do you mean they are required in
XHTML
but optional in HTML ?
Please keep your attribution levels straight.
XHTML also requires all tags, attribute labels and values to be in lower
case and values must be quoted. So your original content should be
<table cellpadding="0" cellspacing="0" border="0" align="center"
width="621">
<tr>
<td rowspan="2"><img width="15" height="1"
src="../images/spacer.gif"></td>
You should install the HTML Validtor plug-in for Firefox and use it
regularly to catch all of the errors you can. Some of this can also be
replaced with style sheets.
Bob McConnell
In addition to what Bob wrote, do yourself a favor and use css to
more style declarations (cellpadding, border, align) to a css file.
That's much easier to maintain.
Cheers,
tedd
--
-------
http://sperling.com/
--- End Message ---
--- Begin Message ---
'Twas brillig, and Bob McConnell at 28/02/11 13:23 did gyre and gimble:
> XHTML also requires all tags, attribute labels and values to be in lower
> case and values must be quoted. So your original content should be
>
> <table cellpadding="0" cellspacing="0" border="0" align="center"
> width="621">
> <tr>
> <td rowspan="2"><img width="15" height="1"
> src="../images/spacer.gif"></td>
>
Actually, in xhtml the <img> tag would need a corresponding </img> tag,
or it can be self closing:
e.g. <img width="15" height="1" src="../images/spacer.gif" />
(technically the space before the /> bit above is not needed, but used
to be needed to stop older versions of IE from exploding... these
probably are not worth worrying about these days tho')
Col
--
Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/
Day Job:
Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
Mageia Contributor [http://www.mageia.org/]
PulseAudio Hacker [http://www.pulseaudio.org/]
Trac Hacker [http://trac.edgewall.org/]
--- End Message ---
--- Begin Message ---
From: Colin Guthrie
>'Twas brillig, and Bob McConnell at 28/02/11 13:23 did gyre and gimble:
>> XHTML also requires all tags, attribute labels and values to be in
lower
>> case and values must be quoted. So your original content should be
>>
>> <table cellpadding="0" cellspacing="0" border="0" align="center"
>> width="621">
>> <tr>
>> <td rowspan="2"><img width="15" height="1"
>> src="../images/spacer.gif"></td>
>>
>
> Actually, in xhtml the <img> tag would need a corresponding </img>
tag,
> or it can be self closing:
>
> e.g. <img width="15" height="1" src="../images/spacer.gif" />
>
> (technically the space before the /> bit above is not needed, but used
> to be needed to stop older versions of IE from exploding... these
> probably are not worth worrying about these days tho')
Ooops, forgot that one. XHTML is XML compliant, so all tags must be
closed properly. Also, you can't use the PHP short open tag, because it
collides with a specific XML tag.
Bob McConnell
--- End Message ---
--- Begin Message ---
Hi all,
I need to read several files from the HD, but they are saved in
different encodings. Can I somehow figure out which encoding I should
use when reading the file?
Thanks.
--
Roland Asmann
Senior Software Engineer
adesso Austria GmbH
Floridotower 26. Stock T +43 1 2198790-27
Floridsdorfer Hauptstr. 1 F +43 1 2198790-927
A-1210 Wien M +43 664 88657566
E [email protected]
W www.adesso.at
-------------------------------------------------------------
>>> business. people. technology. <<<
-------------------------------------------------------------
--- End Message ---
--- Begin Message ---
On Mon, Feb 28, 2011 at 06:20:30PM +0100, Asmann, Roland wrote:
> I need to read several files from the HD, but they are saved in
> different encodings. Can I somehow figure out which encoding I should
> use when reading the file?
i think detect the file encoding and decode it.
as for detection try using mb_detect_encoding function.
http://php.net/manual/en/function.mb-detect-encoding.php
it works with (PHP 4 >= 4.0.6, PHP 5)
/Jeffrin.
--
software engineer.
department of computer science
rajagiri school of engineering and technology.
--- End Message ---
--- Begin Message ---
Hi,
I know not strictly a PHP question, but was just wondering if someone
can tell me the regex format for something please.
I need to replace
......
with
--------
That is six periods replaced by eight hyphens.
Many thanks
Alexis
--- End Message ---