Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

special keywords

Homerun31Homerun31 Posts: 99Member
is there a way to make your own special variable things that make an outcome when people enter it into a text field? this might be confusing so heres an example: If someone were to type :) into the textbox it will come out as a happy face image.

Comments

  • netgertnetgert Posts: 331Member
    : is there a way to make your own special variable things that make an outcome when people enter it into a text field? this might be confusing so heres an example: If someone were to type :) into the textbox it will come out as a happy face image.
    :
    just replace the text ([italic]:)[/italic]) with its appropiate html code ([italic]:)[/italic])
    [hr][red][italic][b]N[/b][/red][blue]et[/blue][red][b]G[/b][/red][blue]ert[/italic][/blue][hr]

  • NeakNeak Posts: 87Member
    : just replace the text ([italic]:)[/italic]) with its appropiate html code ([italic]:)[/italic])

    In case you didn't know how to do this, the function is str_replace(). The context is such:[code]str_replace([red]search[/blue], [blue]replace[/blue], [green]string[/blue]);[/code]
    Where [red]search[/blue] is the string to search for, [blue]replace[/blue] is the string to replace it with, and [green]string[/blue] is the string to search through for [red]search[/blue].
    So, what you want to do is something like this:
    [code]$STRING = [purple][whatever your string was][/red];
    str_replace(':)', ':)', $STRING);[/code]
Sign In or Register to comment.