codeigniter - mb_convert_encoding() function is not working in php -


i using library (glocery_crud) in codigniter convert database table csv , working fine on localhost on live server showing me blank page , not creating csv file .

here code -:

    // convert utf-16le , prepend bom     $string_to_export = "\xff\xfe" .mb_convert_encoding($string_to_export, 'utf-16le', 'utf-8');     $filename = "export-".date("y-m-d_h:i:s").".csv";     header('content-type: application/csv;charset=utf-16le');     header('content-disposition: attachment; filename='.$filename);     header("cache-control: no-cache");     echo $string_to_export;     die(); 

if commenting first line geting csv file not formatted in csv () -:

 testing9988312003sdgsgsdgsgvipul@gmail.comsdgfrayear 

it works fine $string_to_export = "\xff\xfe".iconv("utf-8","ucs-2le",$string_to_export);


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -