-1

I can't put a backspace in a File I try with:

fwrite($file, "\tpublic static function byPk(");
foreach ($pk as $column)
    fwrite($file, "\$" . $column->name . ", ");
fwrite($file, "\x08");

But the result in the file is:

Any solution? Thanks! :D

Machavity
  • 30,841
  • 27
  • 92
  • 100
jtwalters
  • 1,024
  • 7
  • 25

1 Answers1

0

A solution is to use fseek() to go backward. http://php.net/manual/fr/function.fseek.php

You can also make an array with your columns names and implode them.

fdglefevre
  • 672
  • 4
  • 15