Jump to content

[SOLVED] Unexpected T_IF


40esp

Recommended Posts

I just dont understand this. Usually T_IF errors are related to a missing semicolon before an if.

 

 

heres my code:

 

 <?php
$day = if ($_GET['d'] > 1) { $_GET['d']; } else { echo "0"; }
$month = if ($_GET['m'] > 1) { $_GET['m']; } else { echo "0"; }
$year = if ($_GET['y'] > 1) { $_GET['y']; } else { echo "0"; } ?>

 

can you help me?

Link to comment
https://forums.phpfreaks.com/topic/85841-solved-unexpected-t_if/
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.