i need to create a description of a web page using php.

the code should input a url,
then it should create a description of that web page content in around 300-400 words.
here, the url redirects to another page and i wish to create the description to that redirected page.

this may be similar to creating a meta description tag with the url as an input.

please help me.
thank you