在css中使用php,substr_count()搜索文件位置

i have some question about php in css
my projet folde

What i'm trying to do : count <li> with php in css
Probleme : cannot find the right location

more information : <link rel="stylesheet" href="./css/style.php"> in my "head.php"

in my style.php

<?php
  header("Content-type: text/css; charset: UTF-8");
  $menu="../index.php";
  $li=substr_count($menu,"<li>");
  echo $menu;
?>

i tried "../index.php"; "../inc/menu.php"; "./inc/menu.php"; no one work

you can try something like this

$menu = file_get_contents('../index.php');
$liCount = substr_count($menu,'<li>');
echo $liCount;