Ok, this little script is supposed to make my life easier by automatically generating links for matched strings, but it's not replacing properly with the $links element that corresponds with the $terms element. It's just putting "Array" in where the corresponding $links element should be. The examples for this function on the php.net site are atrocious for beginners, btw.
<?php
$what = $_POST['url'];
$source = file_get_contents($what);
$terms = explode(",", file_get_contents('engTerms.txt'));
$links = explode(",", file_get_contents('engLinks.txt'));
$whatsnew = preg_replace($terms, '<a href="' . $links . '">$0</a>', $source);
echo $whatsnew;
?>
Please note that '/' have been added to the terms and I've tried to reference the $terms key, but that key seems to always eval to '0' so I get the first link in $links in all the replacements! UGH! This SHOULD be really easy to do!!!