What potential legal issues should be considered when scraping content from other websites in PHP?

One potential legal issue when scraping content from other websites in PHP is copyright infringement. To avoid this, make sure to only scrape content that is publicly available and not protected by copyright. Additionally, always give proper attribution to the original source of the content.

// Example code snippet for giving proper attribution when scraping content
echo "Content scraped from: www.example.com";