PDA

View Full Version : Changing Dynamically Words in Text



young_coder
06-21-2010, 04:43 PM
Dear all,
I need to change dynamically ###KEYWORD### in text with same word or phrase like in echo ($keyword);
Text with ###KEYWORD### is dynamic content. It is displayed RSS feed.
Can it be done..?
Thank you

<?php
session_start();
$_SESSION['raw_query'] = $_GET['q'];
$_SESSION['ad_group'] = str_replace("-", " ", $_GET['q']);

$keyword = $_SESSION["ad_group"];
echo ($keyword);
?>

<p>This is text, and ###KEYWORD### is word I wish to replace with same thing that is in "echo ($keyword);".</p>

Beverleyh
06-21-2010, 06:18 PM
Im not sure what you're trying to do - does this help?

<p>This is text, and <?php echo $keyword; ?> is word I wish to replace with same thing that is in "echo ($keyword);".</p>

young_coder
06-21-2010, 06:33 PM
I have tried to do str_replace on wrong place…
Now it is OK... working...
Thank you on help :)