Hi there,
I am working on a small project for learning PHP better.
This project has a primary file, which opens another website (e.g. youtube) by using fopen
+ fread
. (or file_get_contents
?)
The site will be saved into a variable and after that a function will parse the file's content and should replace certain items with advanced content, for example:
<div onclick="play(id=12432);">
Play Video
</div>
replace with
<div onclick="play(id=12432);">
Play Video
<div>
<div onclick="add2fav(id=12432);">
Add to favorites
</div>
Any idea how someone can perform this without huge performance leeks and clean code?
It is just about "loading a website", "advance its content", "echo it".