I have an array like this:
Array
(
[error] = Array
(
[0] = Password field is required.
[1] = Sorry, unrecognized username or password. <a href="/user/password">Have you forgotten your password?</a>
)
)
In the above array I need to add an class in the link. My expected output should be like:
Array
(
[error] = Array
(
[0] = Password field is required.
[1] = Sorry, unrecognized username or password. <a href="/user/password" class="popups">Have you forgotten your password?</a>
)
)
How do I change the array value?
You could use a function like str_replace on it before printing the link to the page.