Welcome Guest, Not a member yet? Register   Sign In
How can I save variables in database to display in textarea?
#4

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.

Reply


Messages In This Thread
RE: How can I save variables in database to display in textarea? - by Rufnex - 11-20-2014, 10:42 AM



Theme © iAndrew 2016 - Forum software by © MyBB