在copy()错误重定向页面 - PHP

The normal copy("thisflie.php","here.php")or die("error message");

Can I use if(copy()) { redirect page}

If there is an error in the copy() how can I redirect the page.

If you check the documentation, you can see copy() return TRUE or FALSE so you can simply do:

if(copy($source, $dest) === false){
   // error here
}

Honestly, first port of call should be the docs. And as a side note, or die() should never be "normal", you should handle your errors, not just kill the script mid-execution.

just use this

if(copy() === false){
   // error here
}

http://php.net/manual/en/function.copy.php

Return Values

Returns TRUE on success or FALSE on failure.

So yes , u can !