php - Escape Spaces in this script? -
i'm using php create config file make executable , works fine when file name doesn't have spaces when file have spaces doesn't work.
the file name inside $readyfile variable.
what can fix ?
$content = ";!@install@!utf-8! title=\"auto-extract\" executefile=\"runner.exe\" executeparameters=\"--exe 2999.exe --file $readyfile\" ;!@installend@!"; $fp = fopen("config.txt","wb"); fwrite($fp,$content); fclose($fp);
thanks
you can strip using regex.
$content=preg_replace('/\s+/', '', $content);
Comments
Post a Comment