Hi,
anyone familiar with FPDF ?
I'm using this to create PDF documents.

The input to FPDF is a number of strings.
However, whenever I give a string that contains an apostrophe (') FPDF truncates the string from the apostrophe onwards.

Anyone know how to solve this?

Thanks,
John.

    try changing the string to:

    $your_string = htmlentities($your_string, ENT_QUOTES);

      A little more searching has shown that the problem is not in FPDF but is in the fields I'm sending to the FPDF routine. If the string in $paragraph[2] contains an apostrophe the string is truncated.

      echo "<input type='hidden' name='paragraph2' value='$paragraph[2]'>";

      I can, of course, always change the apostrophe to eg %%% before posting and then change %%% back to an apostrophe after posting but there must be a more correct solution.

      Any help appreciated.

        echo "<input type='hidden' name='paragraph2' value='".htmlentities($paragraph[2], ENT_QUOTES)."'>";

          Write a Reply...