Jump to content

Link Array


ShoeLace1291

Recommended Posts

I have two arrays, the first builds the references and names of the links, the second builds the html for the links.  I do this because I want to use implode to display a bullet in between them.  This is my code:

 

if($result['accnt_found']){

		$link = array(
			  		  'link1href' => "index.php",
					  'link1name' => '', $board['name'], ' Home',
					  'link2href' => "logout.php",
					  'link2name' => "Logout",
					  'link3href' => "profile.php",
					  'link3name' => "My Profile",
					  'link4href' => "members.php",
					  'link4name' => "Members",
					  'link5href' => "events.php",
					  'link5name' => "index.php?act=events",
					  'link6href' => "index.php?act=help",
					  'link6name' => "Help"
					  );
					  
			$buttons = array(
					  		'link1' => '<a href="', $link['link1href'], '" name="', $link['link1name'], '">Index</a>',
							'link2' => '<a href="', $link['link2href'], '" name="', $link['link2name'], '">Logout</a>',
							'link3' => '<a href="', $link['link3href'], '" name="', $link['link3name'], '">Profile</a>',
							'link4' => '<a href="', $link['link4href'], '" name="', $link['link4name'], '">Members</a>',
							'link5' => '<a href="', $link['link5href'], '" name="', $link['link5name'], '">Events</a>',
							'link6' => '<a href="', $link['link6href'], '" name="', $link['link6name'], '">Help</a>'
							);

	echo '
		  ', implode('  &#8226  ', $buttons) ,' ';

 

It doesn't display anything.

Link to comment
https://forums.phpfreaks.com/topic/92036-link-array/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.