How Can I display values of variables in a "PHP contextual filter code" to debug my code? I have to use PHP code in contextual filter code in a "Arguments/Contextual Filters" of a view: 

global $user;
$uid=$user-&gt;uid;

$pid=db_query("select pid from profile where uid='$uid';")-&gt;fetchField();

$equipo=db_query("select field_equipo_proyecto_target_id from field_data_field_equipo_proyecto where entity_id='$uid';")-&gt;fetchField();

$num_equipo=db_query("select field_num_equipo_proyecto_value from field_data_field_num_equipo_proyecto where entity_id='$equipo';")-&gt;fetchField();;

printf("%02d",intval($num_equipo));
return sprintf("%02d",intval($num_equipo));


I think I have some error because I can´t get a correct value. I would like to know how display variables such as $num_equipo, etc to debug my code easier.
Install the Devel module with the Search Krumo module and you will be able to use the dpm() function.


  Devel
  
  
  Helper functions for Drupal developers and inquisitive admins.
  Enable the included Kint submodule as for pretty print of variables. kint($array) function is provided, which pretty prints arrays. Useful
  during development. Similarly, a ddebug_backtrace() is offerred.
  


You can read how to use the Devel module at: Debugging Drupal (a page which gives a brief overview of some of the tools you can use to make Drupal development and debugging easier).