0

I'm having problems with a string, I don't know why but my string is being cutted off. I write this (where L::something are translated texts):

$secondHtml = "<div style='display:block; width:100%; height:30%; padding:0; padding-top:30px; margin:0; background:#ffffff'>
                <p style='font-weight:bold; text-align:center; '>".L::miregalo."</p><p style='text-align:center; '>".L::detalle.': ' . round($row["var"]/100,2) . '&euro; ' . $row["var"]."</p>
                <p style='text-align:center; padding-bottom:30px'>$mensajelink</p>
                <div style='display:block; font-size:12px; float:left; width:440px; min-height:200px; padding:10px; margin-right:20px;padding-left:0;'>
                    <p>$var2<a href='http://www.myweb.com/user/register' target='_blank' style='color:#009BAE;text-decoration:none;'>".L::registrate."</a></p>
                    <p>$var1<span style='color:#009BAE;'>". $row['var'] ."</span></p>
                </div>";

And I'm getting this:

<div style='display:block; width:100%; height:30%; padding:0; padding-top:30px; margin:0; background:#ffffff'>
                <p style='font-weight:bold; text-align:center; '>Nire oparia zertan datza?</p><p style='text-align:center; '>Opariaren xehetasuna: 0&euro; hurrengo tokian: <a href='http://www.myweb.com/eu/commerce/28/STORE'><span style='color:#009BAE;'>STORE</span></a></p>
                <p style='text-align:center; padding-bottom:30px'>Ikusi tokiak <a href='http://myweb.com' target='_blank' style='color:#009BAE; font-style:italic; text-decoration:none;'><span class='primera-font'>Web-n</span></a></p>
                <div style='display:block; font-size:12px; float:left; width:440px; min-height:200px; padding:10px; margin-right:20px;padding-left:0;'>
                    <p>Zure oparia beste toki baten aldatzea nahi baduzu edo erabilera epea aldatu, <a href='http://www.myweb.com/user/register' target='_blank' style='color:#009BAE;text-decoration:none;'>Izena eman</a></p>
                    <p>Aukeratutako tokian truk

The last words are part of a translated string, and I don't know why is cutting it. Additionaly, if I put the whole string in one line I get the next text:

(the initial part is the same)... target='_blank' style='color:#009BAE;text-decoration:none;'>Izena eman</a></p> <p>Aukeratutako tokian trukatzen baduzu, balioaren %2-

So my question is, I'm creating a too long string? Is there a maximum size? The maximum size is really so small?

Jon Zangitu
  • 957
  • 1
  • 15
  • 30
  • Where does `L::something` come from? Is it a static method in some class? – Andrei Nov 20 '15 at 12:16
  • Will you be able to add `$val` value? – AnkiiG Nov 20 '15 at 12:17
  • I'm using a library, https://github.com/Philipp15b/php-i18n – Jon Zangitu Nov 20 '15 at 12:18
  • add to the string do you mean AG21? I've got no error but no text is added to the $secondHtml variable. – Jon Zangitu Nov 20 '15 at 12:18
  • @JonZangitu I mean to add in question. – AnkiiG Nov 20 '15 at 12:23
  • Assuming you hardcode the `L::something` texts, does the output still get cut off? – Andrei Nov 20 '15 at 12:24
  • I have hardcoded and is still getting cutted off Andrew... – Jon Zangitu Nov 20 '15 at 12:25
  • Well at least that library is not the problem, leave them hardcoded for now. How are you outputting the string? – Andrei Nov 20 '15 at 12:26
  • I'm using a library to output in PDF format, but debugging I'm watching the variable before outputing anything and is cutted off! I don't understand. – Jon Zangitu Nov 20 '15 at 12:28
  • 1
    You're gonna have to post more code. Start by posting the library name and preferably a link to the github and the code to your class, or whatever it is that takes care of the output itself. – Andrei Nov 20 '15 at 12:29
  • I'm reviewing it, but in the translate library I have some html code in the variables I'm using, and maybe the single-double quotes are the issue. – Jon Zangitu Nov 20 '15 at 12:44
  • 1
    Maybe instead of using `"` and `'` try using the [heredoc](http://stackoverflow.com/questions/5673269/what-is-the-advantage-of-using-heredoc-in-php) see if that makes a difference. Either way, more code pl0x. – Andrei Nov 20 '15 at 12:48

0 Answers0