How can I save variables in database to display in textarea? |
Ok, for that you need a placeholder replacement. For e.g. you have text like that
Code: $txt = "the user %username% are crazy"; This string can be saved in the database and after get it back he has to be replaced with the needed content like that PHP Code: str_replace_first('%username%', $r->lastName, $txt_back_from_db); See details at http://php.net/manual/de/function.str-replace.php or search here for preg_replace. Hope this helps. |
Messages In This Thread |
How can I save variables in database to display in textarea? - by alexandervj - 11-20-2014, 10:16 AM
RE: How can I save variables in database to display in textarea? - by Rufnex - 11-20-2014, 10:24 AM
RE: How can I save variables in database to display in textarea? - by alexandervj - 11-20-2014, 10:33 AM
RE: How can I save variables in database to display in textarea? - by Rufnex - 11-20-2014, 10:42 AM
RE: How can I save variables in database to display in textarea? - by alexandervj - 11-20-2014, 10:50 AM
RE: How can I save variables in database to display in textarea? - by alexandervj - 11-24-2014, 01:07 PM
RE: How can I save variables in database to display in textarea? - by Rufnex - 11-24-2014, 02:34 PM
RE: How can I save variables in database to display in textarea? - by alexandervj - 11-24-2014, 02:42 PM
RE: How can I save variables in database to display in textarea? - by InsiteFX - 11-24-2014, 11:13 PM
|