special keywords - Programmers Heaven

Howdy, Stranger!

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

Categories

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.