jQuery , , NumberFormatter , $.ajax - , . ( , ru ). :
index.php
<form method="POST" action="index.php">
<label for="zahl">Zahl:</label> <br/>
<input id="zahl" name="zahl" type="number" size="15" maxlength="15"><br/><br/>
<div id="results" style="width: 400px;"></div>
</form>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('#zahl').on('keyup', function(){
$.ajax({ url: 'number_process.php', type: 'POST', dataType: 'text', data: {value: $(this).val()},
success: function(response) {
$('#results').text(response);
}
});
});
});
</script>
number_process.php ( )
php, ajax. .
<?php
if(isset($_POST['value'])) {
$ru = new NumberFormatter("ru", NumberFormatter::SPELLOUT);
$value = $ru->format($_POST['value']);
echo mb_convert_encoding($value, 'UTF-8', 'auto');
exit;
}
?>