Hi all,
I am building a kind of vocabulary hangman type game using php preg_replace to remove random letters from words and replace them with text input fields which when the users enter what they think the missing letter is should be submitted to my mysql database for checking.
I am rather lost on how to convert the input “value” to echo php code needed to import the letter to my cms db…
In my php file I have the following:
[php]<? echo preg_replace("/$selected_letter/", "", $str); ?>[/php]
This echoes out into my page:
with no problems
What I really need to echo is the following:
Doing the following doesn’t works as I am unable to echo [php]<?php echo htmlspecialchars(@$_REQUEST['test']) ?>[/php] within the preg_replace echo if that makes sense…
[php]<? echo preg_replace("/$selected_letter/", "" />", $str); ?>[/php]
I would greatly appreciate it if someone could point me in the right direction as to how I can acheive this?
Many Thanks!