src/PoInitAbstract.php
public function escapeForPo(string $string): string
    {
        if ($string[0]=='"' || $string[0]=="'") {
            $string = substr($string, 1, -1);
        }
        $string = str_replace("\r\n", "\n", $string);
        $string = stripcslashes($string);
        return addcslashes($string, "\0..\37\"");
    }
public function escapeForPo(string $string): string
    {
        if ($string[0]=='"' || $string[0]=="'") {
            $string = substr($string, 1, -1);
        }
        $string = str_replace("\r\n", "\n", $string);
        $string = stripcslashes($string);
        return addcslashes($string, "\0..\37\"");
    }
public function escapeForPo ( string $ string ) : string { if ( $ string [ 0 ] == '"' || $ string [ 0 ] == "'" ) { $ string = substr ( $ string , 1 , - 1 ) ; } $ string = str_replace ( "\r\n" , "\n" , $ string ) ; $ string = stripcslashes ( $ string ) ; return addcslashes ( $ string , "\0..\37\"" ) ; }
Prepare a string from tokenized output for use in a po file. Remove any
surrounding quotes, escape control characters and double quotes.

@param string $string raw string (T_STRING) identified by php token_get_all

@return string
Prepare a string from tokenized output for use in a po file . Remove any surrounding quotes escape control characters and double quotes .