Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Styling first element

New Here ,
Dec 28, 2009 Dec 28, 2009

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
340
Translate
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)); ?>

Translate
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)); ?>

Translate
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
LATEST

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

Leo

Translate
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