# Comparing Arrays with PHP

**URL:** https://forum.kirupa.com/t/comparing-arrays-with-php/208584
**Category:** programming
**Created:** [November 30, 2006, 6:41am UTC](https://forum.kirupa.com/t/comparing-arrays-with-php/208584 "2006-11-30T06:41:10Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![nobody](https://avatars.discourse-cdn.com/v4/letter/n/94ad74/32.png) [@nobody](https://forum.kirupa.com/u/nobody)
#### Post date: [November 30, 2006, 6:41am UTC](https://forum.kirupa.com/t/comparing-arrays-with-php/208584/1 "2006-11-30T06:41:10Z")

</div>

Hello I am back with more questions because I still suck.

So I have two arrays. $dates\_arr which contains a numerical date for each row in my database within a certain month. Ie it could be something like [0]=\>4 [1]=\>21. That would mean there was a post on the 4th and 21st. Duh.

I also have a $thismonth array that spits out every day of a particular month in an array. So it’s something like [0]=1 [1]=2 [2]=3 … [29]=30. Awesome!

Then later on I have $thismonth spit out an unordered list with a foreach. What I want to do, somehow, is compare these two arrays so that when there are matching values it puts out an li with a different class name or something. Doesn’t matter what it does, I can figure that out, just needs to somehow compare like that.

Any ideas? I am really awful with arrays, so this is more or less killing me.
