/    Sign up×
Community /Pin to ProfileBookmark

hello, im fairly new to php and do not know to much about it. so im hoping their are a few people in here that know a fair bit of php.

[U]what i want to accomplish[/U]
i want a text box within a form. I want people to be able to type in text into this text box just like any other text box. i then want their to be a submit button and when pressed it changes the text the user entered into the text box into diffrent characters from character map ( i must choose what they are changed to eg a = α, houston = ноusтои.) These are not characters on your keyboard well some are but some are not can you help please ?

code snippet would be excelent

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@andre4s_yFeb 22.2009 — [code=php]
<?php
//houston
$pattern[]="#h#";
$pattern[]="#o#";
$pattern[]="#u#";
$pattern[]="#s#";
$pattern[]="#t#";
$pattern[]="#n#";
//http://www.w3.org/TR/REC-html40/charset.html#h-5.3.1
$replacement[]="& #1085;";//without space between & and #
$replacement[]="& #1086;";//without space between & and #
$replacement[]="u";
$replacement[]="s";
$replacement[]="& #1090;";//without space between & and #
$replacement[]="& #1080;";//without space between & and #
$subject = "houston";
$output = preg_replace($pattern,$replacement,$subject);
echo $output;
?>
[/code]

You can use UTF-8 or UTF-16 : learn here.

You can use str_replace() function too...

And do your form by yourself.. ?

hope this helps..
×

Success!

Help @ryanhouston spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...