Lo he probado, pero por alguna razón no funciona. Debe tener algún error.
Lo he colocado así:
Código:
<?php
$uri = $_SERVER['REQUEST_URI'];
// Primero, quedarnos con la parte que interesa.
$prefix="categorias/";
$suffix=substr($p,strpos($p,$prefix)+strlen($prefix));
// Ahora, en $suffix tenemos "categoria-b","categoria-a",etc.
?>
<link href="css/<?php echo $suffix;?>.css" rel="stylesheet" type="text/css" />
<script src="javascript/<?php echo $suffix;?>"></script>';
Me introduce esto:
<link href="/css/.css" rel="stylesheet" type="text/css" />
<script src="/javascript/"></script>';
Además, en la cabecera del frontend parecer el final del script (';).