Forgot to post this, but if anyone is wondering what I've done for this, I've posted it below.
PHP Code:
function checkCollision(firstx, firsty, firstw, firsth, secondx, secondy, secondw, secondh) {
if ((firstx <= secondx && firstx+firstw >= secondx+secondw) || (firstx >= secondx && firstx+firstw <= secondx+secondw) || (firstx <= secondx && firstx+firstw >= secondx) || (firstx <= secondx+secondw && firstx+firstw >= secondx+secondw)) {
if ((firsty <= secondy && firsty+firsth >= secondy+secondh) || (firsty >= secondy && firsty+firsth <= secondy+secondh) || (firsty <= secondy && firsty+firsth >= secondy) || (firsty <= secondy+secondh && firsty+firsth >= secondy+secondh)) {
return true;
}
}
}