mercredi 4 novembre 2015

String with commands to use in if

i have a string like this:

$final ='and ( ($este=="2015-10-11") and ($este=="2015-10-18") and ($este=="2015-10-25") and ($este=="2015-11-01") and ($este=="2015-11-08") and ($este=="2015-11-15") and ($este=="2015-11-22") and ($este=="2015-11-29") )';

and i want to make it works in a if statement

if (($este=='2015-11-5') $final and (!$bPreviousMonth && !$bNextMonth))

Is that possible? who i do it?

I'm making a calendar and i need to this dates appear of diffrent way.

// Generate rows for the calendar
for ($i = 0; $i < 6; $i++) { // 6-weeks range
$sCalTblRows .= '<tr>';
for ($j = 0; $j < 7; $j++) { // 7 days a week

    $sClass = '';
    if ($iNowYear == $iYear && $iNowMonth == $iMonth && $iNowDay == $iCurrentDay && !$bPreviousMonth && !$bNextMonth) {
        $sClass = 'today';
    } elseif (!$bPreviousMonth && !$bNextMonth) {
        $sClass = 'current';
    }






    $este = $iYear.'-'.$iMonth.'-'.$iCurrentDay;    
    if (($este=='2015-11-5')  and (!$bPreviousMonth && !$bNextMonth))
    {
        $sCalTblRows .= '<td class="'.$sClass.'"><a style="color:red;"> Episodio 1 </a></td>';
    }
    else
    {
        $sCalTblRows .= '<td class="'.$sClass.'"><a href="javascript: void(0)">'.$iCurrentDay.'</a></td>';
    }

Aucun commentaire:

Enregistrer un commentaire