', $styleStartPos) + 1; $styleEndPos = strPos ($headText, '', $linkStartPos); // ensure this is a 'stylesheet' link $stylesheetPos = strpos ($headText, "\"text/css\"", $linkStartPos); if (($stylesheetPos !== false) && ($stylesheetPos < $linkEndPos)){ // get the 'href' attribute value $hrefPos = strpos ($headText, 'href', $linkStartPos); if ($hrefPos !== false){ $hrefPos = strpos ($headText, '=', $hrefPos); if ($hrefPos !== false){ $hrefPos += '1'; // get first character in attribute value $index = $hrefPos; // find first attribute character while (($headText[$index] == " ") || ($headText[$index] == '\'') || ($headText[$index] == "\"")){ $index++; if ($index > strlen($headText)){ break; } } $indexStart = $index; // find end of attribute character $indexEnd = $indexStart; while (($headText[$indexEnd] != " ") && ($headText[$indexEnd] != '\'') && ($headText[$indexEnd] != "\"")){ $indexEnd++; if ($index > strlen($headText)){ break; } } } } // convert the href attribute value to an "import url" statement $importStatement = '@import url('.$path.substr ($headText, $indexStart, ($indexEnd - $indexStart)).');'; $styleText = $styleText."\n".$importStatement; } // look for another 'link' element $linkStartPos = strpos ($headText, '