#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Location
    Denmark
    Posts
    53
    Rep Power
    15
    I'm trying to use the same function on several bits of text (actually more than three) in order to avoiding empty lines in them while inserting them to a mySQL-db, but this dosn't seem to work (the function itself does):

    FUNCTION ombrud(&$str) {
    $str = ereg_replace("[nr]{2,}","n",$str);
    array($str, $str, $str);
    }

    $dage = array($text1, $text2,text3);
    array_walk ($dage, ombrud);

    Of course, I could call the function several times:
    ombrud(text1)
    ombrud(text2)
    ombrud(text3)
    ... and so on, but...?

    Ole, Denmark
  2. #2
  3. No Profile Picture
    Apprentice Deity
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 1999
    Location
    Niagara Falls (On the wrong side of the gorge)
    Posts
    3,237
    Rep Power
    19
    You have to place quotes around the function name in array_walk

    array_walk($array,'function_name');

Similar Threads

  1. Uploading Files
    By vivekjain in forum ASP Programming
    Replies: 0
    Last Post: February 17th, 2004, 12:21 AM
  2. Calling a JavaScript function from VBScript
    By starbar in forum JavaScript Development
    Replies: 3
    Last Post: February 7th, 2004, 05:31 PM
  3. Calling a function that is inside a differend class
    By Skull-Splitter in forum C Programming
    Replies: 3
    Last Post: January 31st, 2004, 08:39 AM
  4. Trouble calling onClick event from a function.
    By frankyvalley in forum ASP Programming
    Replies: 1
    Last Post: January 21st, 2004, 02:57 PM
  5. Replies: 3
    Last Post: December 23rd, 2003, 08:18 PM

IMN logo majestic logo threadwatch logo seochat tools logo