What is the correct file encoding setting? It's set as western european file encoding but should it be something else for php like ASCII or UTF-8?
I don't understand what it means, could someone point me in the right direction?
If your only using ASCII characters it shouldn't matter encoding you choose - I recommend to use UTF-8, as it's hard to go wrong with the UTF-8 encoding (as it supports unicode and is well supported by variety of applications).
Thankyou for getting back so quickly. I've now set it for UTF-8 for PHP. Will this affect things if I combine html; the default setting for html is western european 1252?
Depends upon what you mean by combine. Note that a file can only have one encoding.
If your using Komodo to copy/paste between a PHP file (UTF-8 encoded) and a HTML file (western european encoded) then Komodo will transparently convert the encodings as necessary.
Sorry I'm really new to this so it's still a bit confusing. What I meant was if I included php within html code like below, will the html still be read properly if it's UTF-8 and do I still save it as .php or .htm?
html
head // I left the <> out deliberately but you get the idea
/head
body
<?php
// set original price and discount
$origPrice = "100";
$discount = "25";
A mixed PHP and HTML file is still treated as PHP (i.e. it's parsed by the PHP interpreter) - so keep it the same (i.e. UTF-8).
Once again - if your not using any unicode (i.e. your not using funky characters, or non-english languages) then you really don't need to worry about the encoding.
If your only using ASCII characters it shouldn't matter encoding you choose - I recommend to use UTF-8, as it's hard to go wrong with the UTF-8 encoding (as it supports unicode and is well supported by variety of applications).
There is a good article that covers PHP encodings here:
http://www.phpwact.org/php/i18n/charsets
Cheers,
Todd
Thankyou for getting back so quickly. I've now set it for UTF-8 for PHP. Will this affect things if I combine html; the default setting for html is western european 1252?
Depends upon what you mean by combine. Note that a file can only have one encoding.
If your using Komodo to copy/paste between a PHP file (UTF-8 encoded) and a HTML file (western european encoded) then Komodo will transparently convert the encodings as necessary.
Cheers,
Todd
Sorry I'm really new to this so it's still a bit confusing. What I meant was if I included php within html code like below, will the html still be read properly if it's UTF-8 and do I still save it as .php or .htm?
html
head // I left the <> out deliberately but you get the idea
/head
body
<?php
// set original price and discount
$origPrice = "100";
$discount = "25";
// calculate discount in percentage
$discountPrice = ($origPrice * $discount) /100;
// calculate sale price
$salePrice = ($origPrice - $discountPrice);
//etc,etc..
?>
A mixed PHP and HTML file is still treated as PHP (i.e. it's parsed by the PHP interpreter) - so keep it the same (i.e. UTF-8).
Once again - if your not using any unicode (i.e. your not using funky characters, or non-english languages) then you really don't need to worry about the encoding.
Cheers,
Todd
thankyou! You've been a great help :-)