[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Event date change color using minical

Posted on 2014-01-29
2
Medium Priority
?
168 Views
Last Modified: 2014-02-20
I posted a question about the php and got an answer that seemed to work. But upon further review, it only works for the current month. It gives this error when I click on to another month.

Warning in_array()[; Wrong datatype for second argument in ... on line 181

Can anyone help?
minical-home.php
0
Comment
Question by:socialbutterfly
2 Comments
 

Author Comment

by:socialbutterfly
ID: 39819802
It's in this section..

echo $adj."<td ";

if (in_array($i,$activedays))

{ echo 'class=today-event ';
}

if (($i == date('d')) && ($m ==date('m'))){

echo "class=today";

}

echo " width='25px'>$thedate</td>";
0
 
LVL 111

Accepted Solution

by:
Ray Paseur earned 2000 total points
ID: 39819902
Good news!  All of the PHP functions are documented in writing on the www.php.net web site.  In the instant case, please see in_array().  According to the documentation, it expects an array for the second argument.  You can test to see if the second argument is an array before you call in_array() and make a programmatic decision whether your script should call the function or choose some other course of action.

If you're new to PHP and want to get a foundation in how the language works, this article may be helpful:
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/A_11769-And-by-the-way-I-am-new-to-PHP.html
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses
Course of the Month20 days, 13 hours left to enroll

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question