Change stylesheet with php

Hello, how can i use php to change a stylesheet on different pages?
was thinking:

$pg2 =  'pageTwo';  //this would be the title of the page
$style1 = '<?php bloginfo('stylesheet_directory'); ?>style.css"> ';
$style2 = '<?php bloginfo('stylesheet_directory'); ?>style2.css"> ';

if($pg1 == 'pageTwo') {
    css =$style2;
} else(!$pg2) {
   css = $style1;

how do i replace the “css” to indicate i want to use that sylesheet?

Thank you

echo ?

will try it out thx.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.