Using php In Arrays
Posted: Sat Jan 08, 2005 6:27 am
feyd | Help us, help you. Please use
But can i replace the code with PHP? All the actual code of the website is stored in my DB and I plan to echo the code and replace things like [date] with <?echo$date;?> but it just comes out as a blank space.
Any help would be great, thanks!
feyd | Help us, help you. Please use
Code: Select all
andCode: Select all
tags where approriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
On my website I am using an array to replace text into htmlCode: Select all
function addcode($input){
$search = array('[general_nav]','[admin_nav]','[welcome]');
$replace = array(
"<b>Navigation:</b><br>
<A href=>Home Page</A><br>
<A href=>Private Forums</A><br>
<A href=>Polls</A><br>
<A href=>News Articles</A><br>",
"<b>Admin:</b><br>
<A href=>General Settings</A><br>
<A href=>Website Colors</A><br>
<A href=admin/headers.php>Headers & footers</A><br>
<A href=>Manage Pages</A><br>
<A href=>Manage Forums</A><br>",
"Welcome, <b>killa</b>:<br>
<a href=>Account Setpup</a><br>
<a href=>Logout</a>"
);
$input = str_replace($search, $replace, $input);
return $input;}Any help would be great, thanks!
feyd | Help us, help you. Please use
Code: Select all
andCode: Select all
tags where approriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]