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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T06:46:30+00:00 2026-06-15T06:46:30+00:00

I am getting SyntaxError: JSON.parse: expected double-quoted property name. I encode a PHP associative

  • 0

I am getting SyntaxError: JSON.parse: expected double-quoted property name.

I encode a PHP associative and Escaped the illegal characters like this:

var TweetsAnalized = '<?php echo addslashes($Row_Words_Repeated_Relation_to_json) ?>';

Then when I JSON I parse it like that: var tweets = JSON.parse(TweetsAnalized);

I get the error.

Here is how the array looks like:

'{\"\":[[\"trial\",\"Cairo\",\"#RamletBoulaq\",\"march\",\"heading\",\"prosecutor\",\"office\",\"#nilecity\",\"#niletowers\",\"Muslim\",\"Brotherhood\",\"chants\",\"chanting\",\"building\",\"9\",\"#AdminCourt\",\"#ConstituentAssembly\",\"dissolution\",\"will\",\"draft\",\"hold\",\"dissolve\",\"today\",\"#Maspero\",\"March\",\"6\",\"#Dokki\",\"#Tahrir\",\"held\",\"protesters\",\"Chants\",\"Bread\",\"freedom\",\"issues\",\"#Morsy\",\"Anti\",\"Mohamed\",\"Mahmoud\",\"people\",\"regime\",\"Al\",\"President\",\"Supreme\",\"Constitutional\",\"Court\",\"postponed\",\"#Egypt\",\"civil\",\"revolution\",\"#Oct19\",\"tomorrow\",\"\\n\",\"writes\",\"greater\",\"good\",\"downfall\",\"constitutional\",\"declaration\",\"Morsy\",null,\"game\",\"wins\",\"Egypt\",\"worst\",\"option\",\"Syrian\",\"refugees\",\"vote\",\"funeral\",\"press\",\"conference\",\"Tahrir\",\"support\",\"decree\",\"crisis\",\"seized\",\"2012\",\"law\",\"clashes\",\"#FJP\",\"offices\",\"injuries\",\"#DNE\",\"latest\",\"bid\",\"#BREAKING\",\"presidential\",\"#Jika\",\"journalist\",\"detained\",\"forces\",\"rebels\",\"#Abdeen\",\"creating\",\"Monday\",\"protests\",\"urges\",\"chief\",\"ahead\",\"attempting\",\"#MB\",\"sit\",\"meeting\",\"Tuesday\",\"injured\",\"temporary\",\"Clashes\",\"Qasr\",\"Shia\",\"#Muslims\",\"claim\",\"entering\",\"#Ashura\",\"#Palestinian\",\"November\",\"#Sinai\",\"#Alexandria\",\"team\",\"Gadalla\",\"decisions\"],[2,2,4,6,4,2,2,4,4,5,6,3,2,2,2,2,4,3,3,2,2,2,4,2,2,2,3,20,3,3,3,2,3,2,16,2,4,4,4,3,6,5,2,2,2,3,34,2,2,2,2,2,5,2,2,2,4,5,7,3,2,2,3,2,2,2,2,2,2,2,3,3,3,3,3,2,2,2,2,2,2,2,33,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,4,2,3,3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2]],\"#Tahrir\":[[\"#Morsy\",\"supporters\",\"Mohamed\",\"Mahmoud\",\"anti\",\"Morsy\",\"protesters\",\"square\",\"Kasr\",\"Nil\",\"empty\",\"pro\",\"throwing\",\"Pro\",\"charge\",\"rock\",\"St\",\"injuries\",\"drove\",\"injured\",\"man\",\"carried\",\"face\",\"march\",\"#Dokki\",\"\",\"held\",\"Chants\",\"Bread\",\"freedom\",\"dissolution\",\"#ConstituentAssembly\",\"heading\",\"demanding\",\"ensued\",\"#FJP\",\"leader\",\"Muslim\",\"Brotherhood\",\"calls\",\"head\",\"building\",\"Clashes\",\"clashes\",\"High\",\"Court\",\"authority\",\"chants\",\"fights\",\"continue\",\"Anti\",\"people\",\"demand\",\"fall\",\"president\",\"groups\",\"parties\",\"holding\",\"#Egypt\",\"civil\",\"Protesters\",\"#Oct19\",\"March\",\"Al\",\"Sayeda\",\"Zeinab\",\"moving\",\"revolution\",\"Badie\",\"today\'s\",\"protests\",\"will\",\"growing\",\"number\",\"street\",\"Cairo\",\"\\n\",\"constitutional\",\"declaration\",\"#DNE\",\"Qasr\",\"National\",\"Rescue\",\"Front\",\"sit\",\"low\",\"Follow\",\"updates\",\"Police\",\"front\",\"gas\",\"Ainy\",\"call\",\"Tuesday\",\"Pictures\",\"infront\",\"demonstration\",\"CSF\",\"#Nov23\",\"Tahrir\",\"thousands\",\"#nov23\",\"path\",\"motorcycles\"],[18,4,8,7,7,6,11,4,2,2,2,5,2,2,3,2,2,2,2,3,2,2,2,10,5,20,4,4,2,2,3,2,4,2,2,2,2,5,6,2,3,2,4,5,3,3,2,4,2,5,2,3,2,2,2,2,2,2,16,2,6,13,3,10,4,4,2,2,2,3,3,3,2,2,2,2,2,2,3,3,6,2,2,2,2,2,2,2,2,3,3,5,2,3,2,2,2,2,2,2,2,10,2,2]],\"#Egypt\":[[\"today\",\"Egyptian\",\"protest\",\"current\",\"conditions\",\"return\",\"Rafah\",\"amid\",\"security\",\"#Copts\",\"arrested\",\"#Syria\",\"International\",\"Mohamed\",\"will\",\"year\",\"charges\",\"years\",\"lawsuit\",\"religion\",\"protesters\",\"Al\",\"presidential\",\"demanding\",\"building\",\"office\",\"#Morsy\",\"gas\",\"pile\",\"National\",\"Front\",\"Supreme\",\"Constitutional\",\"court\",\"constitutional\",\"continue\",\"strike\",\"demands\",\"#Sinai\",\"Friday\",\"#Oct19\",\"#Tahrir\",\"groups\",\"\",\"representative\",\"#FJP\",\"head\",\"party\",\"#BREAKING\",\"#DNE\",\"clashes\",\"front\",\"offices\",\"injuries\",\"regime\",\"held\",\"#Damanhour\",\"President\",\"Council\",\"Judges\",\"declaration\",\"attempting\",\"#MB\",\"changes\",\"location\",\"Tuesday\",\"#Abdeen\",\"Brotherhood\",\"High\",\"Court\",\"Clashes\",\"Rescue\",\"sit\",\"Muslim\",\"march\",\"crisis\",\"BREAKING\",\"call\",\"Morsy\",\"demonstration\",\"#Alexandria\",\"#Nov23\"],[4,2,3,3,2,2,2,2,2,3,2,2,2,2,2,2,2,2,2,2,2,4,2,2,2,2,16,2,2,4,4,2,2,2,4,2,2,2,2,2,3,16,2,34,2,3,2,2,4,27,4,2,2,2,2,3,2,4,2,2,4,2,6,2,2,5,2,3,2,2,2,3,2,2,3,2,2,2,2,2,2,2]],\"#Morsy\":[[\"judges\",\"supporters\",\"prosecutor\",\"general\",\"#Tahrir\",\"Mohamed\",\"Mahmoud\",\"anti\",\"Morsy\",\"protesters\",\"square\",\"Kasr\",\"Nil\",\"pro\",\"throwing\",\"Pro\",\"charge\",\"rock\",\"injuries\",\"Brotherhood\",\"High\",\"Court\",\"#FJP\",\"Muslim\",\"authority\",\"chants\",\"issues\",\"\",\"Anti\",\"people\",\"demand\",\"fall\",\"president\",\"office\",\"#Egypt\",\"President\",\"hours\",\"finished\",\"clashes\",\"#DNE\",\"#BREAKING\",\"decree\",\"constitutional\",\"declaration\",\"temporary\",\"will\",\"held\",\"Tuesday\",\"#MB\"],[3,4,2,2,18,7,5,6,5,6,3,2,2,5,2,2,2,2,3,4,2,2,2,3,2,2,2,16,2,3,2,2,2,2,16,5,2,2,2,7,2,2,2,3,2,2,2,2,2]],\"#DNE\":[[\"#BREAKING\",\"#Egypt\",\"#Tahrir\",\"clashes\",\"#FJP\",\"offices\",...al\",\"hold\",\"meeting\",\"discuss\",\"move\",\"#nov23\",\"#tahrir\",\"#egypt\"],[2,2,2,2,2,2,2,2,2]],\"team\":[[\"meeting\",\"#nov23\",\"#tahrir\",\"#egypt\",\"decides\",\"resign\",\"presidential\",\"\"],[2,2,2,2,2,2,2,2]],\"support\":[[\"\"],[3]],\"revolution\":[[\"will\",\"\",\"#Tahrir\"],[2,2,2]],\"protest\":[[\"governorates\",\"#Egypt\",\"#Oct19\"],[2,3,2]],\"prosecutor\":[[\"#RamletBoulaq\",\"office\",\"#nilecity\",\"#niletowers\",\"general\",\"#Morsy\"],[2,2,2,2,3,2]],\"president\":[[\"#Morsy\",\"people\",\"#Tahrir\"],[2,2,2]],\"postponed\":[[\"\"],[3]],\"office\":[[\"#RamletBoulaq\",\"march\",\"General\",\"prosecutor\",\"#nilecity\",\"#niletowers\",\"general\",\"#Egypt\",\"#Morsy\"],[2,2,2,2,2,2,2,2,2]],\"leader\":[[\"#FJP\",\"Brotherhood\",\"calls\",\"#Tahrir\",\"head\",\"building\"],[2,2,2,2,2,2]],\"held\":[[\"march\",\"#Tahrir\",\"\",\"#Egypt\",\"Tuesday\",\"#Morsy\"],[2,4,3,3,2,2]],\"front\":[[\"#Egypt\",\"gas\",\"#Tahrir\"],[2,2,3]],\"draft\":[[\"\",\"Supreme\",\"Constitutional\",\"rejects\"],[2,2,2,2]],\"current\":[[\"Egyptian\",\"#Egypt\"],[2,3]],\"crisis\":[[\"\",\"#Egypt\"],[3,2]],\"court\":[[\"high\",\"#Egypt\"],[2,2]],\"conference\":[[\"\"],[3]],\"calls\":[[\"#FJP\",\"leader\",\"Brotherhood\",\"#Tahrir\",\"head\",\"building\"],[2,2,2,2,2,2]],\"Zeinab\":[[\"Sayeda\",\"march\",\"#Tahrir\",\"#Oct19\",\"moving\"],[3,3,4,4,2]],\"US\":[],\"Sayeda\":[[\"Zeinab\",\"march\",\"#Tahrir\",\"#Oct19\",\"moving\"],[3,3,4,4,2]],\"Presidential\":[[\"#nov23\",\"team\",\"hold\",\"meeting\",\"tomorrow\",\"discuss\",\"move\",\"#tahrir\",\"#egypt\"],[3,2,2,2,2,2,2,2,2]],\"National\":[[\"Front\",\"#Egypt\",\"Rescue\",\"#Tahrir\"],[3,4,3,2]],null:[[\"declaration\",\"\"],[2,3]],\"Front\":[[\"National\",\"#Egypt\",\"Rescue\",\"#Tahrir\"],[3,4,3,2]],\"Egypt\":[[\"worst\",\"option\",\"Syrian\",\"refugees\",\"\"],[2,2,2,2,3]],\"Constitutional\":[[\"#Egypt\",\"Supreme\",\"rejects\",\"draft\",\"\",\"declaration\"],[2,2,2,2,2,2]],\"Chants\":[[\"\",\"Bread\",\"freedom\",\"dissolution\",\"#ConstituentAssembly\",\"#Dokki\",\"march\",\"heading\",\"#Tahrir\"],[2,2,2,2,2,2,2,2,4]],\"Cairo\":[[\"\",\"#Tahrir\"],[2,2]],\"#tahrir\":[[\"#nov23\",\"Presidential\",\"team\",\"hold\",\"meeting\",\"tomorrow\",\"discuss\",\"move\",\"#egypt\"],[4,2,2,2,2,2,2,2,3]],\"#BREAKING\":[[\"#DNE\",\"#Egypt\",\"#Morsy\",\"\"],[4,4,2,2]],\"urges\":[[\"\"],[2]],\"trial\":[[\"contempt\",\"religion\",\"\"],[2,2,2]],\"today\'s\":[[\"protests\",\"#Oct19\",\"#Tahrir\"],[2,2,3]],\"thousands\":[[\"#Tahrir\",\"#nov23\"],[2,2]],\"strike\":[[\"#Egypt\"],[2]],\"street\":[[\"#Tahrir\"],[2]],\"sit\":[[\"#DNE\",\"\",\"#Tahrir\",\"#Egypt\"],[2,2,2,2]],\"security\":[[\"#Egypt\"],[2]],\"rights\":[[\"human\"],[2]],\"residents\":[[\"#RamletBoulaq\",\"#niletowers\",\"#nilecity\"],[2,2,2]],\"religion\":[[\"trial\",\"contempt\",\"#Copts\",\"#Egypt\"],[2,2,2,2]],\"regime\":[[\"\",\"people\",\"#DNE\",\"#Egypt\"],[3,2,2,2]],\"moving\":[[\"march\",\"Sayeda\",\"Zeinab\",\"#Oct19\",\"#Tahrir\"],[2,2,2,2,2]],\"minister\":[],\"man\":[[\"#Tahrir\"],[2]],\"leave\":[[\"#RamletBoulaq\",\"#nilecity\",\"#niletowers\"],[2,2,2]],\"law\":[[\"\"],[2]],\"justice\":[],\"judges\":[[\"#Morsy\",\"President\"],[3,2]],\"injuries\":[[\"#Morsy\",\"#Tahrir\",\"#Egypt\",\"\"],[3,2,2,2]],\"high\":[[\"court\",\"building\"],[2,2]],\"groups\":[[\"#Tahrir\",\"#Egypt\"],[2,2]],\"freedom\":[[\"\",\"Bread\",\"dissolution\",\"#Tahrir\"],[3,2,2,2]],\"face\":[[\"#Tahrir\"],[2]],\"expected\":[[\"will\"],[2]],\"entering\":[[\"\"],[2]],\"demands\":[[\"#Egypt\"],[2]],\"demanding\":[[\"#Tahrir\",\"#Egypt\"],[2,2]],\"decree\":[[\"\",\"#Morsy\"],[3,2]],\"constitution\":[[\"#ConstituentAssembly\"],[2]],\"chief\":[[\"\"],[2]],\"charge\":[[\"#Morsy\",\"rock\",\"#Tahrir\",\"protesters\",\"drove\"],[2,2,3,2,2]],\"car\":[[\"bomb\"],[2]],\"Thousands\":[],\"Supreme\":[[\"Constitutional\",\"rejects\",\"draft\",\"\"],[2,2,2,2]],\"Rescue\":[[\"National\",\"Front\",\"#Tahrir\",\"#Egypt\"],[2,3,2,3]],\"Pictures\":[[\"#Tahrir\"],[2]],\"October\":[[\"#AdminCourt\",\"postpones\",\"#ConstituentAssembly\",\"case\",\"16\",\"#EgyCourts\"],[2,2,2,2,2,2]],\"General\":[[\"office\",\"Egyptian\"],[2,2]],\"Erian\":[[\"#FJP\",\"head\",\"party\",\"Al\"],[2,3,3,2]],\"Egyptian\":[[\"current\",\"#Egypt\",\"General\"],[2,2,2]],\"Council\":[[\"#Egypt\"],[2]],\"CSF\":[[\"High\",\"Court\",\"protesters\",\"#Tahrir\"],[2,2,2,2]],\"BREAKING\":[[\"#Egypt\"],[2]],\"April\":[[\"will\"],[2]],\"#egypt\":[[\"Presidential\",\"team\",\"hold\",\"meeting\",\"tomorrow\",\"discuss\",\"move\",\"#nov23\",\"#tahrir\"],[2,2,2,2,2,2,2,3,3]],\"#Sinai\":[[\"#Egypt\",\"\"],[2,2]],\"#Nov23\":[[\"#Tahrir\",\"#Egypt\"],[2,2]],\"#FreeAlber\":[[\"lawyer\",\"prosecution\",\"#PT\",\"moved\"],[2,2,2,2]],\"#EgyCourts\":[[\"#AdminCourt\",\"postpones\",\"#ConstituentAssembly\",\"case\",\"October\",\"16\"],[2,2,3,3,2,2]],\"#Copts\":[[\"#Egypt\",\"religion\"],[3,2]],\"#Abdeen\":[[\"Palace\",\"\",\"#MB\",\"changes\",\"location\",\"Tuesday\",\"#DNE\",\"#Egypt\"],[2,2,2,2,2,2,2,2]]}';

Please need help with that Problem.

Edit: here the whole Process on how i get the $Row_Words_Repeated_Relation.

while($Repeatitive_max > 4)
     { 
         $Row_Words_Repeated_TweetsList= array();     
             $Row_Words_Repeated_counter=0;
             $IRow=0;
             $counter2=0;
             $Icolo=0;
             $Row_Words_Repeated_Count=array();
             $Row_Words_Repeated_Count[0][0]=" ";

             for($RRow=0 ;$RRow < sizeof($Array_TweetExplode); $RRow++)
             {
                 if(in_array($BigMatrix_Filtered[0][$Repeatition_position], $Array_TweetExplode[$RRow]))
                 {      
                     for($ICol=0;$ICol<sizeof($Array_TweetExplode[$RRow]);$ICol++)
                     {
                           if(!in_array($Array_TweetExplode[$RRow][$ICol],$Row_Words_Repeated_Count[0])
                           && $BigMatrix_Filtered[0][$Repeatition_position] != $Array_TweetExplode[$RRow][$ICol])
                           {  
                             $Row_Words_Repeated_Count[0][$counter2]= $Array_TweetExplode[$RRow][$ICol];                             
                             $counter2++;
                           }
                     }
                 }
             }
             for($RRow=0 ;$RRow < sizeof($Array_TweetExplode); $RRow++)
             {
                 if(in_array($BigMatrix_Filtered[0][$Repeatition_position], $Array_TweetExplode[$RRow]))
                 {      
                     for($ICol=0;$ICol<sizeof($Array_TweetExplode[$RRow]);$ICol++)
                     {
                        $Row_Words_Repeated_TweetsList[$IRow][$ICol]= $Array_TweetExplode[$RRow][$ICol];
                     }
                     $IRow++;
                 }
             }
             $RowCounter=1;
             for($Row=0;$Row<sizeof($Array_TweetExplode);$Row++)
             {
                 if(in_array($BigMatrix_Filtered[0][$Repeatition_position], $Array_TweetExplode[$Row]))
                 {
                      for($ColCounter=0;$ColCounter<sizeof($Row_Words_Repeated_Count[0]);$ColCounter++)
                      {
                          $Row_Words_Repeated_Count[$RowCounter][$ColCounter]=0;
                      }
                      $RowCounter++;
                 }
             }
             $RowCounter=1;
             for($RRow=0;$RRow<sizeof($Row_Words_Repeated_TweetsList);$RRow++)
             {
                 for($CCol=0;$CCol<sizeof($Row_Words_Repeated_TweetsList[$RRow]);$CCol++)
                 {

                    $Position = array_search($Row_Words_Repeated_TweetsList[$RRow][$CCol],$Row_Words_Repeated_Count[0]);
                    if($Position !== false)
                    {
                        if($Position != NULL || $Position >= 0 )
                        {            
                             $Row_Words_Repeated_Count[$RRow+1][$Position] = 1;
                             $var=0;
                        }                    
                    }             
                 }
                 $var =0;                                           
             }
             $Repeatiton_count=0;
             $finalRow2=sizeof($Row_Words_Repeated_Count);
             for($CCol=0;$CCol<sizeof($Row_Words_Repeated_Count[0]);$CCol++)
             {   
                for($RRow=1;$RRow<sizeof($Row_Words_Repeated_Count)-1;$RRow++)
                {
                    if($Row_Words_Repeated_Count[$RRow][$CCol] == 1)
                    {
                        $Repeatiton_count++;
                    }                
                }


                $Row_Words_Repeated_Count[$finalRow2][$CCol] = $Repeatiton_count;
                $Repeatiton_count=0;  

             }
             $Row_Words_Repeated_Relation[$BigMatrix_Filtered[0][$Repeatition_position]]= array();
             $counter2=0;    
             for($CCol=0;$CCol<sizeof($Row_Words_Repeated_Count[$finalRow2]);$CCol++)
             {
                if($Row_Words_Repeated_Count[$finalRow2][$CCol] > 1)
                {
                    $Row_Words_Repeated_Relation[$BigMatrix_Filtered[0][$Repeatition_position]][0][$counter2]= $Row_Words_Repeated_Count[0][$CCol];
                    $Row_Words_Repeated_Relation[$BigMatrix_Filtered[0][$Repeatition_position]][1][$counter2]= $Row_Words_Repeated_Count[$finalRow2][$CCol];
                    $counter2++;

                } 
             }
             if($Maximum_Counter >= sizeof($Array_OfCounters))
             {
                 break;
             }
             $Repeatitive_max = $Array_OfCounters[$Maximum_Counter];
             $FLAG=0;
             $InterCounter=0;
             for($CCol=0;$CCol<sizeof($BigMatrix_Filtered[$finalRow]);$CCol++)
             {
                if($Repeatitive_max == $BigMatrix_Filtered[$finalRow][$CCol])
                {

                     foreach ($Row_Words_Repeated_Relation as $key_name => $key_value) 
                     {
                        if($BigMatrix_Filtered[0][$CCol] != $key_name)
                        {
                            $InterCounter++;   
                        }
                      }
                      $Zaha2 = sizeof($Row_Words_Repeated_Relation);
                      if($InterCounter==sizeof($Row_Words_Repeated_Relation))
                      {
                          $Repeatition_position = $CCol;
                          $FLAG=1;
                          $InterCounter=0;
                          break;
                      }
                      else
                      {

                          $InterCounter=0;;
                      }

                }
                if($FLAG==1)
                {
                    $FLAG=0;
                    break;                     
                } 
             }

             $WholeRepeatedWordsCounter++;
             $Maximum_Counter++;


     }
     return $Row_Words_Repeated_Relation;

I retrieve from Database BTW and the process works fine when the While Loop is set to > 4 like in the listed code, however when its set to greater than 2 it give me the error. ALSO when i tried and added more data to the database it gave me the same error.

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

    The problem is that you mix up different worlds. addslashes used to be something for SQL queries (although something bad since it was not database-engine-specific). There is absolutely no reason to mix it with JSON.

    What you do want instead is this:

    var TweetsAnalyzed = <?php echo json_encode($Row_Words_Repeated_Relation); ?>;
    

    This will convert the PHP array/object into a proper JavaScript object (because JSON is exactly that: a JavaScript object literal with a stricter syntax). You do not have to escape anything etc – json_encode will always output valid JavaScript.

    In case $Row_Words_Repeated_Relation_to_json actually contains the return value of json_encode simply use it like this:

    var TweetsAnalyzed = <?php echo $Row_Words_Repeated_Relation_to_json; ?>;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am getting SyntaxError:JSON.parse in the ajax error function and when trying to validate
Hi im getting a error saying that adwhirl cannot parse json response Im trying
For some reason I'm getting SyntaxError: invalid label error when I receive JSON data
I'm trying to execute the following code, but I'm getting SyntaxError: invalid syntax at
I'm getting an error [Exception: SyntaxError: Unexpected token :] when I try to evaluate
I'm trying to parse a JSON string served up from my Sinatra/DataMapper backend, but
I am using node.js and trying to parse the JSON body of a request.
<?php /* ... Getting record from database */ $comment = $record[comment]; /* There might
I am getting this error: SyntaxError: hello.rb:13: syntax error, unexpected tIDENTIFIER public HelloWorld( InputStream
I keep getting this error: SyntaxError: Unexpected token o For a v.simple piece of

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.