2014-09-08, 02:39 PM
I am trying to find image tags in the post and then: Check if the image has alt="" tag if not then add one!
It just adds code to all images?
It just adds code to all images?
$value = preg_match_all('/<img (.*?)\/>/', $post->data['message']);
if(!preg_match('/alt=/', $value))
{
$post['message'] = str_replace('<img', '<img alt="'.$string.'"', $post['message']);
}