0

Here is line 5 for($i=2005,$i<2016,$i++){

here is the rest of the code just in case anybody asks.

<?php
echo $today = date("m/d/Y")."<br/>";
$myString = "The quick brown fox jumps over the lazy dog";
$year = $i+4;
for($i=2005,$i<2016,$i++){
if($i+date("L"))
echo $year()is a leap year; 
$myString = strtoupper($myString);
}else{
echo $year() is not a leap year;
$myString = strtolower($myString);}
if($i=2015)
echo "The quick brown fox jumps over the lazy dog";
str_replace(fox,cat);
?>
Brandi
  • 19
  • 2
  • 3
    Read about the [`for` statement](http://php.net/manual/en/control-structures.for.php). – axiac Nov 22 '17 at 14:14
  • You also have errors in the line `echo $year() is not a leap year;` -- `$year` is a number, not a function and the rest of the line cannot be parsed. – axiac Nov 22 '17 at 14:15
  • And when reading about the `for()` statement, look closely at the `;` and the `,` – Mark Baker Nov 22 '17 at 14:15
  • 1
    `if($i=2015)` must be `if ($i == 2015)` (`=` is [assignment](http://php.net/manual/en/language.operators.assignment.php), `==` is [comparison](http://php.net/manual/en/language.operators.comparison.php)). – axiac Nov 22 '17 at 14:16
  • your'e using comma instead of semi colons inside for statement. read about for statements.[link](https://www.w3schools.com/php/php_looping_for.asp) – Naresh Kumar Nov 22 '17 at 14:17
  • `str_replace(fox,cat);` -- PHP thinks `fox` and `cat` are [named constants](http://php.net/manual/en/function.define.php). If they are not [`define()`](http://php.net/manual/en/function.define.php)-ed it uses the `'fox'` and `'cat'` strings instead. [`str_replace()`](http://php.net/manual/en/function.str-replace.php) expects 3 arguments and since you don't care about the value it returns, the statement doesn't have any effect (apart from triggering errors and warnings). – axiac Nov 22 '17 at 14:18
  • `if($i+date("L"))` should be `if (date("L"))`. As it is now, the condition is always [`true`](http://php.net/manual/en/types.comparisons.php) (the value of `$i+date("L")` is a number between `2005` and `2015`). – axiac Nov 22 '17 at 14:21
  • thank you. This is such a headache I feel like I'll never get this right. – Brandi Nov 22 '17 at 14:25

0 Answers0