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 9233347
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T06:31:57+00:00 2026-06-18T06:31:57+00:00

I have the fallowing string in php: $code = [[],[Mon,01, 1.7, 8,3, 96,33, 29.01.2013],[Tue,01,

  • 0

I have the fallowing string in php:

    $code = "[[],["Mon","01","  1.7","  8","3"," 96","33","
29.01.2013"],["Tue","01","  0.3"," 24","2","100","16","
30.01.2013"],["Wed","01","  5.4"," 28","2"," 98","5","
31.01.2013"],["Thu","01","  8.7"," 22","3"," 92","23","
01.02.2013"],["Fri","01","  5.1"," 43","3"," 91","22","
02.02.2013"],["Sat","01","  2.8"," 18","2"," 90","22","
03.02.2013"],["Sun","01","  2.1"," 31","6"," 93","34","
04.02.2013"]]";

Now i try to decode this string with json_decode. But the result ist this one:

NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL

The code to output is this:

$code = json_decode($code);
print_r($code);

Why this dont work ? THis is the first time i have problems with json_decode …

  • 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-18T06:31:58+00:00Added an answer on June 18, 2026 at 6:31 am

    Assuming that the contents of $code are all in a string (and not a php array like the syntax is now), the error is the fact that you have newlines inside of the strings.

    ["Mon","01","  1.7","  8","3"," 96","33","
    

    Notice how there is an open quote at the end of the line .. that makes for invalid JSON.

    If you get rid of all of the newlines, it actually does work. Here’s my proof:

    array(8) {
      [0]=>
      array(0) {
      }
      [1]=>
      array(8) {
        [0]=>
        string(3) "Mon"
        [1]=>
        string(2) "01"
        [2]=>
        string(5) "  1.7"
        [3]=>
        string(3) "  8"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have following code in php: $mode = $this->input->get('mode'); // may return string or
i have used following code in my c# application string verification_url = @http://site.com/posttest.php?; string
I have the following PHP code and would like to split the string into
i have the following piece of code in php: define('QUERY', $some_query_string); if(empty(QUERY) || mb_strlen(QUERY)
I have following PHP code $val=<div id=user.$row['cid']. userid=.$row['cid']. class=innertxt><img src=images/images.jpg width=50 height=50><strong>.$uname.</strong><ul> <li>Email: .$row['cemail'].</li>
I have the following code: <div><strong>Name: </strong><?php echo anchor('http://'.$link, $row->Name); ?></div> Which takes a
I have the following almost JSON string: <?php $string = '{0:{id:1,name:Antiek en Kunst,subs:[{id:2,name:Antiek |
I have the following PHP code, but it's not working. I don't see any
I have the following code in PHP: if (preg_match('@^[a-z0-9/._-]+$@i', $script) && !preg_match('@([.][.])|([.]/)|(//)@', $script)) I'm
RewriteEngine on I have following code: RewriteCond %{REQUEST_URL} ^$ RewriteRule ^files/(.*)$ getfile.php?file=$1 [L] RewriteRule

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.