Replacing a CSS class using PHP? -
i'm building backend web application, possible change design of page. once user has setup design way it, should able save , new design written specific file.
for reason, need replace characters between {
, }
after string, name of class.
so simple concept, following class in seperate file load view, style.php. need go from:
from
<style> .bonus { bottom: 6px; left: 247px; } </style>
to
<style> .bonus { bottom: 20px; left: 450px; } </style>
could recommend me on best way to
a) find string in file,
b) when found, replace between 2 strings right after first string.
thank you.
i don't concept of user making changes actual file much. there lot of safer methods user create , maintain custom template without them making changes php file.
what storing user's css in field in database? you'd need like:
<?php $css = getcssbyuserid($userid); //function runs query on db user-specific css /* $css = ".bonus { bottom: 20px; left: 450px; }" */ ?> <style> <?php echo $css; ?> </style>
Comments
Post a Comment