Reputation: 251
Is there any method to change words to full-width like:
123 ->123
Because I have to turn Japanese words to full-width, I cannot use some way like enumeration. ( like: str_replace('1','1',$string); str_replace('2','2',$string); ... and so on.)
How do I solve the problem?
And, is it possible to force user typing full-width words?
My web is written in PHP, and I know how to combine with javascript.
The typing I already clarify is like:
onKeyUp="value=value.replace(/[\x00-\xff]/g,'')"
(The upper regular expression is enable user typing Japanese like 'カメラ', Chinese like '你好', and full-width words, that is what I want.)
But I don't know how to force the user typing full-width words; like can force user input English or numeric words.( Or it is impossible to do it)
Any replying appreciate!
Upvotes: 0
Views: 71
Reputation: 1576
There are several options to achieve this but I think the easiest is to use the kbd
HTML tag:
<kbd>Some text in here</kbd>
You can also try an experimental CSS solution:
p {
text-transform: full-width
}
Finally, try CSS letter-spacing
to achieve a similar effect with the right font.
Upvotes: 3