A style class is part of CSS which operates on HTML.
The class your referring to, in PHP, is altogether different, describing an 'object'.
If you wish to add a class via php, the simplest way is, when rendering the code, put a class=... attribute inside it.
For example:
<?php
ECHO "<div class='cssStyle'> some content </div>";
?>
You must have the class 'cssStyle' defined in php file that's sent to the browser, either directly, or as a part of a style sheet.
Study up:
CSS3[
^] You may very likely need to study HTML and php, as well.