tags:

views:

51

answers:

1

Iam working with json

My application get string that encoded by json_encode().

Example : The string like this {"data":"1", "data":"2", "data":"3"}

My app work well,

But if browser give me something before i get my string like this: skdjksdjksdj{"data":"1", "data":"2", "data":"3"}

My app will get all skdjksdjksdj{"data":"1", "data":"2", "data":"3"} and don't work

How i can take only {"data":"1", "data":"2", "data":"3"} without "skdjksdjksdj" ?

i don't want to use str_replace , i don't want to output something to browser before output string that was encode by json , and maybe aslo after that

sorry for my bad english

P/S:

Exampele: i addtion something like "bla bla bla" before json data

bla bla bla bla bla
myDataJson
bla bla bla bla bla

my app will get above content to paser , but catch error with "bla bla bla "

How to filter to get only myDataJson

A: 

I believe that only solutions here works this way - DO NOT OUTPUT ANYTHING BUT YOUR JSON STRING! You are the one who makes your app to output like anything. So you have to deal with this :)

Anpher
i use joomla cms. If joomla output something before my json data , my app will not work. :(
Chameron