In my website, I'm using get_the_content() to display the contents of my posts. But, my post video URL, which is youtube here, also getting displayed along with my content.
I tried using preg_replace() to avoid the string that has the youtube URL. But I want to do it dynamically, by using beginning of the string 'https://www.youtube.com/watch?v' to replace it with empty string.
I'm exactly looking for something like this.
$description = preg_replace('https://www.youtube.com/watch?v=f0cReHKUiJM', '', get_the_content());
Please share your ideas on how can I accomplish this.
Thanks in advance.