0

这是我的 PHP 函数:

function dashesToCamelCase($string, $capitalizeFirstCharacter = false) 
{

    //$str = str_replace(' ', '', ucwords(str_replace('-', ' ', $string)));
    $string = preg_replace( '/-(.?)/e',"strtoupper('$1')", strtolower( $string ) );

    if (!$capitalizeFirstCharacter) {
        $string[0] = strtolower($string[0]);
    }

    return $string;
}

echo dashesToCamelCase('e-F-I-L-Re-T-Fa');

这是我的一些 HTML:

<header>
    <ul>
      <li><a href="index.php">EFILRETFA</a></li>    
    </ul>
<div id = "linkone" >
<a href="http://www.efilretfa.org/">
<img src="image/maps/five.jpg"</a>
</div>


<?php
include 'includes/menu.php'; 
?>

<div class="clear"></div>
</header>

这是与此标题相关的 CSS:

a:link { 
color: grey;
background-color: white;
font-size: 15px;
border: 10px outset white;
font-family:2em Arial Black;
text-transform: uppercase;
text-decoration: none;
text-shadow : 5px silver;
}

a:visited { 
color: grey;
background-color: white;
font-size: 10px;
border: 10px outset white;
font-family:2em Arial Black;
text-transform: uppercase;
text-decoration: none;
text-shadow : 1px 2px 5px silver;
}

a:hover{
color: white;
background-color: grey;
font-size: 15px;
border: 10px inset white;
font-family:2em Arial Black;
text-transform: uppercase;
text-decoration: red;
letter-spacing: 3px;
word-spacing: 3px;
font-weight: bold;
text-shadow : 1px 2px 5px silver;
}

我想将 PHP 函数应用于包含在“a”标签中的所有文本的文本,但我不确定哪种方法最好。

谢谢!
梅赛德斯

4

0 回答 0