www.webdeveloper.com
Results 1 to 4 of 4

Thread: [RESOLVED] split error

  1. #1
    Join Date
    Feb 2012
    Posts
    31

    resolved [RESOLVED] split error

    Hi guys,

    i have array containing id and data..my id contain 2 piece of information which i want to split but its showing me error .
    error
    PHP Code:
    Function spliti() is deprecated in 
    my code

    PHP Code:
     foreach($_POST as $key => $data)
     {
         
    //echo "Reading from for eacharray: ".$key."  ".$data."<br/>";
        
         
    $getData=$key."_".$data;
        
        
    $chunks spliti ("_"$getData,10);
        
    print_r($chunks);
        
     } 
    can any help on what im doing wrong

  2. #2
    Join Date
    Feb 2012
    Posts
    218
    Use explode istead
    PHP Code:
    $chunks explode("_"$getData10); 

  3. #3
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,224
    explode() should be perfectly sufficient and preferable for this situation. In a situation where you actually need the power of regular expressions, you should now use preg_split() instead of split() or spliti().
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  4. #4
    Join Date
    Feb 2012
    Posts
    31
    Works Thanks guys!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles