heres my code:
<html> <body>
<? $test = ?>
Some Text
<? include "b.php";
?>
</body> </html>
What i am trying to do is parse a web page via b.php to replace specific words to different words. i kno that having $test = ?> will not work but im wondering how this could work
I don't think posting the same question in different boards is going to garner good responses...
Anyways, you should really read up on the basics of PHP first and learn how to use variables, loops, functions etc. Then try tackling your problem.
Could you elaborate on exactly what you wish to achieve?
Where the specific words in? your mean is you want to replace the "specific words" to different words via b.php I think ,if "$test=the specific words",you could write some code in b.php like "str_replace("specific words","different words",$test)";I think it will be done unless you close the PHP short tag...
Did this board change default language or something overnight?
hjbcool wrote:Where the specific words in? your mean is you want to replace the "specific words" to different words via b.php I think ,if "$test=the specific words",you could write some code in b.php like "str_replace("specific words","different words",$test)";I think it will be done unless you close the PHP short tag...
Yea i have a script querying a database and for each word found it replaces the word in $test. The problem im having is that in a.php all the text i want to have search needs to be php quotes i.e. <? $test = 'some text'; ?> what i want to be able to do is instead of having to quote everything, is it possible to pass the whole html page to b.php?
Thanks for any help