if image fail to load in php code example
Example: js detect all images errors
window.addEventListener("error", e => {
/* query selector images */
// image element on error => replace source
})
window.addEventListener("error", e => {
/* query selector images */
// image element on error => replace source
})