Welcome Guest, Not a member yet? Register   Sign In
Link Info, Arrays, and Foreach
#8

[eluser]davidbehler[/eluser]
Yeah, you can use implode to display an array as a list of it's values seperated by the given delimiter. To do that you simply echo the return value of the implode function which happens to be a string.

From PHP.net:
Quote:Return Values
Returns a string containing a string representation of all the array elements in the same order, with the glue string between each element.

Here you assing an array to your $user var:
Code:
$data['user'] = array(
                                  'Login' => $data['url']."/login",
                                  'Register' => $data['url']."/register",
                                  'Find Pass' => $data['url']."/login/forgot"
                                  );
And here you turn that array into an string by assigning the return value of the implode function to your $user var
Code:
$data['user'] = implode(" | ", $data['user']);

Simply remove that last line and your code should work.


Messages In This Thread
Link Info, Arrays, and Foreach - by El Forum - 12-25-2008, 01:41 AM
Link Info, Arrays, and Foreach - by El Forum - 12-26-2008, 12:40 AM
Link Info, Arrays, and Foreach - by El Forum - 12-26-2008, 01:54 AM
Link Info, Arrays, and Foreach - by El Forum - 12-26-2008, 04:58 AM
Link Info, Arrays, and Foreach - by El Forum - 12-26-2008, 06:56 PM
Link Info, Arrays, and Foreach - by El Forum - 12-26-2008, 07:12 PM
Link Info, Arrays, and Foreach - by El Forum - 12-26-2008, 10:24 PM
Link Info, Arrays, and Foreach - by El Forum - 12-27-2008, 03:16 AM



Theme © iAndrew 2016 - Forum software by © MyBB