Php How to extract substring from a string in PHP The PHP substr() function is used to get the substring that is returns a part of a string. This…