I have an array called $posts which i ran a foreach on like this
foreach ($posts as $post => $content) {
$find = array('~\[image="(https?://.*?\.(?:jpg|jpeg|gif|png|bmp))"\](.*?)\[/image\]~s');
$replace = array('<img src="$1" alt="" /><p>$2</p>');
$content = preg_replace($find, $replace, $content);
}
what i need to do now is to save $content into the same array at the same index as before, how can i do that?
Note that my array has several fields like Id, Author, content, title & date.