Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialPat Costa
4,629 PointsWhy is it I am getting the earlier array?
Here is my code
'<?php
define("YEAR", 2014);
define ("JOB_TITLE", "Teacher");
define ("MAX_BADGES", 150000);
$name = "Mike";
$location="Orlando, FL";
$full_name="Mike the Frog";
$name=$full_name;
?>
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8>
<title> <h1>M<?php echo $name ?> </h1> | Treehouse Profile</title>
<link href="css/style.css" rel="stylesheet" />
</head>
<body>
<section class="sidebar text-center">
<div class="avatar">
<img src="img/avatar.png" alt="Mike The Frog">
</div>
<h1><?php echo $name ?> </h1>
<p> <?php echo $location ?> </p>
<hr />
<p>Welcome to PHP Basics!</p>
<hr />
<ul class="social">
<li><a href=""><span class="icon twitter"></span></a></li>
</ul>
</section>
<section class="main">
<pre>
<?php
$a = 10
$b = 10
$sum =$a + $b;
$diff = $a - $b;
$product = $a * $b;
$qoutient = $a / $b;
?> </pre>
<ul>
<li> <?php echo $sum ?> </li>
<li> <?php echo $diff ?> </li>
<li> <?php echo $product ?> </li>
<li><?php echo $diff ?> </li>
</ul>
</section>
</body>
</html>'
Why am I getting the earlier array? I've cleared my cache.
2 Answers
Greg Kaleka
39,021 PointsI assume you're working on this code in a workspace? Have you saved the change to your file? Tried closing the preview and clicking the preview button?
Also, are you sure you've cleared your cache successfully? Try opening the workspace from another browser.
Benjamin Payne
8,142 PointsYou're not printing out any arrays, so I am not sure why this would be happening. Is that your entire index.php
file?
Greg Kaleka
39,021 PointsBenjamin,
I believe in this course, the students are asked to print those arrays in the prior video. Pat has changed his code from that to the above, and is still seeing the old page. Almost certainly a browser caching issue or a workspace saving issue.
Benjamin Payne
8,142 PointsGreg,
I have to agree. Its been awhile since I went through these videos.
Pat, let me know if you still need help with this.
Ben