laravel的便利

对form表单批量去掉前后空格trim:

$request->merge(array_map('trim', $request->all()));
或
Input::merge(array_map('trim', Input::all()));

  

Laravel中执行Linux SSH命令使用symfony的process

http://symfony.com/doc/current/components/process.html

use Symfony\Component\Process\Process;

$process = new Process('ls -lsa');
$process->run();

// executes after the command finishes
if (!$process->isSuccessful()) {
    throw new \RuntimeException($process->getErrorOutput());
}

echo $process->getOutput();

  

 

你可能感兴趣的:(laravel的便利)