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
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)); ?>
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)); ?>
Copy link to clipboard
Copied
Thank you very much - that has been far beyond my knowledge.
Leo