SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: regex question

  1. #1
    Wibblesticks Gryff's Avatar
    Join Date
    Oct 2001
    Location
    Asgard
    Posts
    442
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    regex question

    if( ereg ("^[[:alpha:]]+$", $username))

    Can I do
    if( ereg ("^[[:alpha:]]+$", $username, $morevariables))
    ?


    Also I want to use a loop for an array
    so
    while($info)
    {
    do stuff
    }

    I want to use htmlspecialchars and stripslashes to make sure all of the elements in the array info are ok
    if they strip+html'ed variables dont match then I want it to say so, can I do this in a simple way? ie not have to write
    $check = htmlspecialcharacters($info[0]);
    $check = stripslashes($info[0]);
    and then compare the original?

    Cheers
    gryff

  2. #2
    Wibblesticks Gryff's Avatar
    Join Date
    Oct 2001
    Location
    Asgard
    Posts
    442
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok I was checking the php documention and found a great function for the latter part of my query

    array_walk ($array, 'function_name');
    It applies a function to every section of the array


Bookmarks

Posting Permissions

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