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;
}

「a」タグで囲まれたすべてのテキストのテキストに PHP 関数を適用したいのですが、どの方法が最適かわかりません。

ありがとう!
メルセデス

4

0 に答える 0