Results 1 to 2 of 2

Thread: [RESOLVED] Replace string from database

  1. #1

    Thread Starter
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Resolved [RESOLVED] Replace string from database

    i make this function to replace strings in a text, from a database:

    PHP Code:
    function form_filter($text) {
        
    $sql "SELECT * FROM `form_filter`";
        
    $query mysql_query($sql);
        while(
    $a mysql_fetch_array($query)) {
            
    $new str_replace($a['replace'], $a['with'], $text);
        }
        return 
    $new;

    and it doesnt work. can some one help?
    My usual boring signature: Something

  2. #2

    Thread Starter
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: Replace string from database

    nevermind. i went with preg_replace, and i just set the arrays from the database
    My usual boring signature: Something

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width