Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8087285
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T18:43:43+00:00 2026-06-05T18:43:43+00:00

I am using parse_ini_file to read the contents of a file however it is

  • 0

I am using parse_ini_file to read the contents of a file however it is not always successful.

For example, this file works fine:


numberofentries=3
File1=http://scfire-dtc-aa05.stream.aol.com:80/stream/1010
Title1=(#1 - 168/11500) Absolutely Smooth Jazz - SKY.FM - the world's smoothest jazz 24 hours a day
Length1=-1
File2=http://scfire-ntc-aa06.stream.aol.com:80/stream/1010
Title2=(#2 - 171/11500) Absolutely Smooth Jazz - SKY.FM - the world's smoothest jazz 24 hours a day
Length1=-1
File3=http://scfire-mtc-aa04.stream.aol.com:80/stream/1010
Title3=(#3 - 175/11500) Absolutely Smooth Jazz - SKY.FM - the world's smoothest jazz 24 hours a day
Length1=-1
Version=2

However when i use parse_ini_file to read the following file I get an error stating it cannot parse the file:


numberofentries=3
File1=http://87.230.82.17:80
Title1=(#1 - 365/1400) DEFJAY.DE - 100% R&B! (GERMANY)
Length1=-1
File2=http://87.230.56.25:80
Title2=(#2 - 370/1400) DEFJAY.DE - 100% R&B! (GERMANY)
Length1=-1
File3=http://87.230.56.32:80
Title3=(#3 - 375/1400) DEFJAY.DE - 100% R&B! (GERMANY)
Length1=-1
Version=2

Here’s my code to read the files:

$file = "test.pls";
$ini_array = parse_ini_file($file, true);
$audiostream = $ini_array['playlist']['File1'];
echo "stream is: ".$audiostream;

I can’t see much difference between the files. Anyone know what’s going wrong?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T18:43:44+00:00Added an answer on June 5, 2026 at 6:43 pm

    First you need to enclose your non-alphanumeric characters

    From manual:

    If a value in the ini file contains any non-alphanumeric characters it needs to be enclosed in double-quotes (“).

    PHP.net – parse_ini_file

    So:

    
     numberofentries=3
     File1="http://87.230.82.17:80"
     Title1="(#1 - 365/1400) DEFJAY.DE - 100% R&B! (GERMANY)"
     Length1=-1
     File2="http://87.230.56.25:80"
     Title2="(#2 - 370/1400) DEFJAY.DE - 100% R&B! (GERMANY)"
     Length1=-1
     File3="http://87.230.56.32:80"
     Title3="(#3 - 375/1400) DEFJAY.DE - 100% R&B! (GERMANY)"
     Length1=-1
     Version=2 
    

    Also please notice that there is reserved words:

    There are reserved words which must not be used as keys for ini files. These include: null, yes, no, true, false, on, off, none. Values null, no and false results in “”, yes and true results in “1”. Characters ?{}|&~![()^” must not be used anywhere in the key and have a special meaning in the value

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using PHPQuery parse HTML file and I need the height and width of
I have an XML file which I need to parse using PHP and send
I parse data using JSON in javascript, I find this is very convenient. But
Using Castor to parse the following xml into POJOs using a mapping file is
Hey I have this kinda structure in my ini file I want to be
Currently I am using MySQLi to parse a CSV file into a Database, that
I have some trouble reading from an ini file using boost program options. The
Using Wikipedia API link to get main image about some world known characters/events. Example
I'm trying to parse a moderately large XML file (6mb) in php using simpleXML.
For some reason when I put my header file in I get this error:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.