Hanging punctuation

Hi everybody. Iā€™m trying to make a Hanging punctuation for my site and found a PHP+CSS solution, but am not sure were and in which way should I add PHP-code. Shoud it be template or a snippet or, may be smartpants.php or config.php. Kindly ask for help.

You can insert the PHP code into a Kirbytext post filter and put the code into a plugin in site/plugins.