Jump to content
php.lv forumi

UTF-8


andrez

Recommended Posts

piemeeram es notepadaa uztaisiiju failu un ieseivoju ar encoding UTF-8

 

uztaiisiju administaaciju caru php kas labo failu un laboto ieseivo.

bet kad notiek ieseivoshana tad encodings paariet uz ANSI :///

 

KAA VAR IESEIVOT FAILUS UTF-8 ENCODINGAA

 

shitaa var noradiit ka teksts ir tajaa encodingaa

$text=utf8_encode($_POST["text"]);

bet kaa lai uzliek ka pats fails ir utf-8 encodinga ?

 

:/

Link to comment
Share on other sites

nu tik muldies!

 

<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body>
<?php
echo '<form action="'.$_SERVER['PHP_SELF'].'" method="post">';
?>
<textarea name="txt" cols="20" rows="6"></textarea>
<input type="submit" value="spiezh" /></form>
<?php
if (isset($_POST['txt']))
{
$fp=fopen('utf8.htm','w');
fwrite($fp,$_POST['txt']);
fclose($fp);
}
@include_once 'utf8.htm';
?>
</body>
</html>

Link to comment
Share on other sites

×
×
  • Create New...