You have to use CSS to affect styles in an html webpage. You use PHP to create the output.
In this particular case, I suppose the easiest would be to use nested divs (ordered lists or whatever you prefer). The structure is created using PHP, and then CSS automatically handles the rest.
<style type="text/css">
.comment {
margin-left: 20px;
}
</style>
</head>
<body>
<div class="comment">
Comment 1
<div class="comment">
1st reply to comment 1
<div class="comment">
1st reply to 1st reply to comment 1
</div>
</div>
<div class="comment">
2nd reply to comment 1
</div>
</div>
<div class="comment">
2nd comment
</div>
<div class="comment">
3rd comment
<div class="comment">
1st reply to comment 3
</div>
</div>
</body>