How to preg_match an array?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to preg_match an array?

    Let's say i have an array
    PHP Code:
    $smileys = array(':)'':('':D'
    and i want to match part of that array how can i use preg_match to achieve this?
    Here's what i tried but it didn't work
    PHP Code:
    if($preg preg_match('/[[:alnum:]]/i'$smileys$matches))
    print_r($matches); 
    The error i get is
    HTML Code:
    Warning: preg_match() expects parameter 2 to be string, array given
    libra.wen.ru

    #2
    PHP Code:
    $matches array_map(function($string) { preg_match('/[[:alnum:]]/i'$string$matches); return $matches; }, $smileys); 

    Comment


      #3
      anabolik is a popular programmer

      Comment


        #4
        foreach("$smileys" as $smiles);

        lol and list will go on
        Visit: Chat4u.mobi - The New Lay Of being a site of your dreams!
        Visit: WapMasterz Coming Back Soon!
        _______
        SCRIPTS FOR SALE BY SUBZERO
        Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders.
        FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others...
        _______
        Info & Tips
        php.net
        w3schools.com

        Comment

        Working...
        X