I am storing HTML data in MySQL database for some reason. how to get all image,css and jss file src from MySQL data and change it to realpath.
Same as to
Using preg_match or preg_replace in PHP
Try to run this regex
Using preg_replace it will be something like this:
preg_replace('/(?:src|href)="(.*?)"/g', 'http:localhost/$1', 'Your field in database');
But test it not in production code, but in your local testing environment as I didn't test it.