Jump to content

$var = $array["value"] Not working


Recommended Posts

So I got this code:


$pageTitle = $illustration["cinematic"]["full_name"];
For some reason it is not showing the proper content
However if I do this:
echo $illustration["cinematic"]["full_name"];
it gives me the result...
What am I doing wrong?
Link to comment
Share on other sites

Because you are only assigning $illustration["cinematic"]["full_name"] to $pageTitle variable, if you were to echo $pageTitle you should get same result as echo $illustration["cinematic"]["full_name"];

That's the thing, I have it echoing in the title of the head of the page. I even tried for the ###### of it to echo again within the body. It comes up blank.

What does this do?

$pageTitle = $illustration["cinematic"]["full_name"];echo "[". $illustration["cinematic"]["full_name"] ."] [". $pageTitle ."]";
I am totally confused...
Link to comment
Share on other sites

You'll have to show all your code, or at least the parts where $pageTitle is being printed. Make sure that the order and scope are correct.


It was order… I got confused because I tried putting:


$pageTitle = $illustration["cinematic"]["full_name"];

echo $pageTitle;


at the end, but there was still no result. This time I placed it after my preloaded php code and before the head loaded (rather than before both) and it functions. I should have clued into that before. Thanks for the nudge :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...