Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to convert string into an array using PHP

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 115
    Comment on it

    Hello Reader's! If you're having a problem to convert a string into an array then you can use the html entity in php. Let's see the example below:-

    & then be sure to use html_entity_decode

    // Input string //
    $input = 'pg_id=2_parent_id=2_document_video';
    
    // Parse //
    parse_str(html_entity_decode($input), $out);
    
    Ouput is :-
    array(
      'pg_id' => 2,
      'parent_id' => 2,
      'document' => ,
      'video' =>
    )
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: