note 113162 deleted from function.exec by cmb

From: Date: Sun, 24 Nov 2019 08:39:18 +0000
Subject: note 113162 deleted from function.exec by cmb
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-213193@lists.php.net to get a copy of this message
Note Submitter: alex dot rigg at yoodoo dot biz ---- I just tried the following: exec('cp "/MySite/web/uploads/' .$matches[1][0]. '/startupvids/mp4/'. substr($fileonly,0,strlen($fileonly)-4) .'.mp4" "/MySite/web/uploads/newfolder/'.$video->getSiteId().'-'.substr($fileonly,0,strlen($fileonly)-4).'.mp4"'); I think exec has an issue with the amount of php commands within the exec - the above doesn't work. To get around this issue put everything into variables before hand so you end up with: $location1 = "/MySite/web/uploads/' .$matches[1][0]. '/startupvids/mp4/'. substr($fileonly,0,strlen($fileonly)-4) .'.mp4"; $location2 = "/MySite/web/uploads/startupvids/mp4/'.$video->getSiteId().'-'.substr($fileonly,0,strlen($fileonly)-4).'.mp4"'; exec('cp '.$location1 .' ' .$location2);

« previous php.notes (#213193) next »