Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • EspaƱol
      • FranƧais
      • PortuguĆŖs
  • ę—„ęœ¬čŖžć‚³ćƒŸćƒ„ćƒ‹ćƒ†ć‚£
    Dedicated community for Japanese speakers
  • ķ•œźµ­ ģ»¤ė®¤ė‹ˆķ‹°
    Dedicated community for Korean speakers
0

Styling first element

New Here ,
Dec 28, 2009 Dec 28, 2009

Copy link to clipboard

Copied

By using  <?php echo htmlspecialchars($row_rsDetails['part1']); ?> I got the text out of a mysql-database table. Now I would like to style the first letter of the first paragraph (<span class="dropCap"), but I cannot imagine how to apply it in a php-rule. How should I manage that?

Leo

TOPICS
Server side applications

Views

291
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Dec 28, 2009 Dec 28, 2009

Use the PHP function substr() to extract the substring:

<span class="dropCap"><?php echo substr($row_rsDetails['part1'], 0, 1); ?></span>

<?php echo htmlspecialchars(substr($row_rsDetails['part1'], 1)); ?>

Votes

Translate
LEGEND ,
Dec 28, 2009 Dec 28, 2009

Copy link to clipboard

Copied

Use the PHP function substr() to extract the substring:

<span class="dropCap"><?php echo substr($row_rsDetails['part1'], 0, 1); ?></span>

<?php echo htmlspecialchars(substr($row_rsDetails['part1'], 1)); ?>

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 28, 2009 Dec 28, 2009

Copy link to clipboard

Copied

LATEST

Thank you very much - that has been far beyond my knowledge.

Leo

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines