How can I change the target of a symlink with PHP? Thanks.
Advertisement
Answer
You can delete the existing link using unlink function and recreate the link to the new target using the symlink function.
symlink($target, $link); . . unlink($link); symlink($new_target, $link);
You need to do error checking for each of these.