Location: PHPKode > scripts > ArKeySwap > arkeyswap/example.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html;charset=windows-1256" />
<link rel="stylesheet" type="text/css" href="style.css" media="all" />
<title>Convert keyboard language programmatically (English - Arabic)</title>
</head>

<body>

<center>
<div style="width: 80%; position:absolute; left:10%; top:0%; z-index:1">
<br />
<div class="tabArea" align="center">
  <a class="tab" href="example.php">Example</a>
  <a class="tab" href="about.html">About</a>
</div>

<div class="Paragraph">

<h2>Example Code1:</h2><br />

<?php

$code = <<<END
<?php
include('ArKeySwap.class.php');
\$x = new ArKeySwap();

\$str = "Hpf lk hgkhs hglj'vtdkK Hpf hg`dk dldg,k f;gdjil Ygn
,p]hkdm hgHl,v tb drt,k ljv]]dk fdk krdqdk>";
echo "<u><i>Before:</i></u><br />\$str<br /><br />";

\$text = \$x->swap_ea(\$str);
echo "<u><i>After:</i></u><br />\$text<br /><br /><b>ÌÈÑÇä Îáíá ÌÈÑÇä</b>";
?>
END;

highlight_string($code);
?>

<h2>Example Output1:</h2><br />

<?php
include('ArKeySwap.class.php');
$x = new ArKeySwap();

$str = "Hpf lk hgkhs hglj'vtdkK Hpf hg`dk dldg,k f;gdjil Ygn
,p]hkdm hgHl,v tb drt,k ljv]]dk fdk krdqdk>";
echo "<u><i>Before:</i></u><br />$str<br /><br />";

$text = $x->swap_ea($str);
echo "<u><i>After:</i></u><br />$text<br /><br /><b>ÌÈÑÇä Îáíá ÌÈÑÇä</b>";
?>
<br /><br />

<h2>Example Code2:</h2><br />

<?php

$code = <<<END
<?php
include('ArKeySwap.class.php');
\$x = new ArKeySwap();

\$str = "öìÛ åìÝËããåáËìÝ ÈÎÎã ÄÔì ÉÔäË ÝÇåìáÓ áÇåááËÞ ÉÎÞË ÄÎÉ
ÍãËÁ Ôìí ÉÎÞË ÑåÎãËìÝÒ ÷Ý ÝÔäËÓ Ô ÝÎÚÄÇ ÎÈ áËìåÚÓ Ôìí Ô ãÎÝ ÎÈ
 ÄÎÚÞÔáË ÝÎ ÉÎÑË åì ÝÇË ÎÍÍÎÓåÝË íåÞËÄÝåÎìÒ";
echo "<u><i>Before:</i></u><br />\$str<br /><br />";

\$text = \$x->swap_ae(\$str);
echo "<u><i>After:</i></u><br />\$text<br /><br /><b>Albert Einstein</b>";
?>
END;

highlight_string($code);
?>

<h2>Example Output2:</h2><br />

<?php
$str = "öìÛ åìÝËããåáËìÝ ÈÎÎã ÄÔì ÉÔäË ÝÇåìáÓ áÇåááËÞ ÉÎÞË ÄÎÉÍãËÁ Ôìí ÉÎÞË ÑåÎãËìÝÒ ÷Ý ÝÔäËÓ Ô ÝÎÚÄÇ ÎÈ áËìåÚÓ Ôìí Ô ãÎÝ ÎÈ ÄÎÚÞÔáË ÝÎ ÉÎÑË åì ÝÇË ÎÍÍÎÓåÝË íåÞËÄÝåÎìÒ";

echo "<u><i>Before:</i></u><br />$str<br /><br />";

$text = $x->swap_ae($str);
echo "<u><i>After:</i></u><br />$text<br /><br /><b>Albert Einstein</b>";
?>
<br /><br />

</div>
</div>
</center>
</body>
</html>
Return current item: ArKeySwap