Tag Archives: variable
PHP Smarty var_dump alternative and prestashop errors
PHP Smarty var_dump alternative and prestashop errors If you work on prestashop for example, and you want to make a debug for all or a certain variable from within a page you will have problems because you cannot use var_dump since Smarty is a templating language for PHP. Method 1
1 2 3 4 5 6 7 |
{php} $var = $this->get_template_vars('var'); var_dump($var); {/php} |
Method 2
1 |
{$var|@print_r} |
Method
Convert variable to string in PHP
Convert variable to string in PHP PHP is a loosely typed language and assigns types to variables depending what is assigned to it. Sometimes you will want to transform a given variable into a string format and obtain a similar output with “ToString()” method in Java or .NET. This could be done easily with one of the following