fork(3) download
  1. <?php
  2.  
  3. $myNumbers = "123,456,778";
  4. $myNumbersExploded = explode(",", $myNumbers);
  5. $myNumbersWithNewCaracter = array_map(function($v){ return "'".$v."'"; }, $myNumbersExploded);
  6. $myNumbers = implode(",", $myNumbersWithNewCaracter);
  7.  
  8. var_dump($myNumbers);
Success #stdin #stdout 0.01s 82560KB
stdin
Standard input is empty
stdout
string(17) "'123','456','778'"