I am trying to create business card QRcode that contains employee picture
if (file_exists($employeeBCpicture)) {
$imagedata = file_get_contents($employeeBCpicture);
$photo64 = base64_encode($imagedata);
}else {//echo 'No<br>';
}
// QR bind_textdomain_codeset
//Include the necessary library for Ubuntu
include_once('/usr/share/phpqrcode/qrlib.php');
//Set the data for QR
$text =
'BEGIN:VCARD'. "\n".
'VERSION:2.1.'. "\n".'
N:'.ucwords($rowe['lname']).';'.ucwords($rowe['fname']).';;;'. "\n".'
FN:'. $fullname. "\n".'
TEL;WORK:+'.$phoneline. "\n".'
TEL;CELL:+'.$mobile. "\n".'
EMAIL;WORK:'.$email. "\n".'
URL;WORK:'.$website. "\n".'
ORG:'.ucwords($rowc['companyname']). "\n".'
TITLE:'.$title. "\n".'
ADR;WORK:;;'.$address.';;'. "\n";
if ($photo64 != ''){
$text = $text.'PHOTO;TYPE=PNG;ENCODING=BASE64:
'.$photo64.' '. "\n".' '
. "\n".' '
. "\n".' ' ;
}
$text = $text.'
END:VCARD';
//Set the filename with unique id
//echo $text.'<br>';
$rfilename = '../../../signatures/'.uniqid().".png";
//Set the error correction Level('L')
$e_correction = 'L';
//Set pixel size
$pixel_size = 2;
//Set the frame size
$frame_size = 2;
//Generates QR image
QRcode::png($text, $rfilename, $e_correction, $pixel_size, $frame_size);
my problem is the \n is not working and it is necessary to add new lines the QR code works when the following section is commented (to remove the photo section) the photo section needs three \n 3 new lines to work also I will need to add new lines to format the business card
if ($photo64 != ''){
$text = $text.'PHOTO;TYPE=PNG;ENCODING=BASE64:
'.$photo64.' '. "\n".' '
. "\n".' '
. "\n".' ' ;
}
My problem is the php variable $text is giving me inline output and I need to separate the lines before using the QRcode function
Thanks in advance for help