Webform submission values with PHP I am using webform 2 pdf module, where I am trying to set up a custom content to the pdf file.

I would like to acces the webform submission data, but I have no idea how to do it. Basically I would like to access them and use them as tokens.

I am on a basic level with both drupal and php, which means I have limits.

//simple first section    
&lt;h1 align="center" style="font-family:verdana;" style="font-size:14;"&gt;&lt;b&gt;Registration&lt;b&gt;&lt;/h1&gt;&lt;br&gt;

&lt;p style="text-align:left; font-family:verdana; font-size:12;" &gt;&lt;b&gt;1. Registered Data:&lt;/b&gt;&lt;/p&gt;
&lt;p style="text-align:left; font-family:verdana; font-weight: normal; font-size:12;" &gt;[submission:values:personal_info:key]&lt;/p&gt;

&lt;p style="text-align:left; font-family:verdana; font-size:12;" &gt;&lt;b&gt;2.  Declaration:&lt;/b&gt;&lt;/p&gt;
// there comes the non-working php part
&lt;p&gt;&lt;?php 
    $var=($fields["institutuonal info"]);
    if ($var == "spec_inst") {
      echo "some juristic stuff";
    }
    ?&gt;&lt;/p&gt;


So I am trying to export webform submission results to PDF, but the result depends on the submission content.
So I partly was able to access webform values. I still have a problem, that I cannot access to one single submission, altough I tried $sid = GET[sid] method. So here is my partly good code:

    //simple first section    
&lt;h1 align="center" style="font-family:verdana;" style="font-size:14;"&gt;&lt;b&gt;Registration&lt;b&gt;&lt;/h1&gt;&lt;br&gt;

&lt;p style="text-align:left; font-family:verdana; font-size:12;" &gt;&lt;b&gt;1. Registered Data:&lt;/b&gt;&lt;/p&gt;
&lt;p style="text-align:left; font-family:verdana; font-weight: normal; font-size:12;" &gt;[submission:values:personal_info:key]&lt;/p&gt;

&lt;p style="text-align:left; font-family:verdana; font-size:12;" &gt;&lt;b&gt;2.  Declaration:&lt;/b&gt;&lt;/p&gt;


&lt;?php
$submissions = webform_get_submissions(array('nid'=&gt;1));
foreach ($submissions as $submission){
foreach ($submission-&gt;data as $row=&gt;$data){
        if ($row == 4){
              if (in_array("0", $data)) {
                    print("long boring text content");
}}}}
?&gt;


So still not what I wanted but that is another question.