Adding error messages
I would use an associative array (also known as  a "map" or "dictionary" in other languages).

$errorMessages = array('emailInvalid' =&gt; 'Invalid email',
    'passLength' =&gt; 'invalid password length',
    'passLowerCase' =&gt; 'missing lower case character in password'
    // and so on...
); 


Then I would loop across this map:

foreach ($errorDetails as $key =&gt; $value) {
    if (strpos($errorDetails, $key) !== false) {
        $errorList .= '&lt;li&gt;' . $value . '&lt;/li&gt;';
    }
}


strpos

Storing your error-message stubs in $errorDetails is inefficient. strpos loops through the string each time. I'd recommend to instead append your error messages to an array, which would open up the possibility of looking up the full error message from something like emailInvalid with a O(1) complexity.

How did I know it was a map that was needed?

Let's look at this code:

if(strpos($errorDetails, "emailInvalid") !== false){
    $errorList .= "&lt;li&gt;Some text&lt;/li&gt;";
}
if(strpos($errorDetails, "passLength") !== false){
    $errorList .= "&lt;li&gt;Some (other) text&lt;/li&gt;";
}


There are two things that differs here, these parts can be simplified to:

if (strpos($errorDetails, $xxxxxxx) !== false) {
    $errorList .= $yyyyyyy;
}


To clean up this code, we could extract a method and call that multiple times, such as:

addErrorList($errorDetails, 'emailInvalid', 'invalid e-mail');
addErrorList($errorDetails, 'passLength', 'invalid password length');
...


However, this is still not very nice. A map / associative array contains a key to value mapping, which is precisely what you have here. For each specific error detail key, there is an associated error message. So add those values to an associative array and then loop through it.