• NollieHeel

    (@nollieheel)


    If I were to assign a value/name to a specific position in a string of text, how would I accomplish that?

    For ex:
    <p>This is a ParagrapH</p>

    I want to assign the 19th position in the index (the capital letter ‘H’) to be a variable.

    So that later on, if I wanted to replace it with a capital ‘G’, I would be able to, etc.

Viewing 1 replies (of 1 total)
  • vtxyzzy

    (@vtxyzzy)

    Exactly how you do that depends on where the variable gets set and how the text gets displayed. If it is echoed by php, you could do something like this:

    <?php
    $text_variable = 'H';
    echo "<p>This is a Paragrap$text_variable</p>";
Viewing 1 replies (of 1 total)
  • The topic ‘index position in text’ is closed to new replies.