$mediaAlbum,'; $newLine = '\'mediaAlbum\' => $mediaAlbumObject,'; if (strpos($content, $oldLine) !== false) { $content = str_replace($oldLine, $newLine, $content); file_put_contents($file, $content); echo "\n-> [SUCCESS] Patch fs_media_gallery applied!\n\n"; } else { echo "\n-> [INFO] Patch fs_media_gallery not applied or row not found.\n\n"; } } else { echo "\n-> [ERROR] Unable to find fs-media-gallery file.\n\n"; }