I want to search for the following string through the source code of website 'mywebsite.com' with fopen; http://sub.example.com/example.php?id=**random id** but do not want to include let's say http://sub2.example.com?id=**random id**.
Example:
Expand|Select|Wrap|Line Numbers
- $openurl = fopen('http://www.mywebsite.com', "r");
- while(! feof($openurl))
- {
- //Which code do I need to use here?
- }
<img src="http://sub.example.com/example.php?id=12345">
to this:
<img src="http://sub2.example.com/00123/?id=12345">
What code should I use to find these strings in the above mentioned example coding?