codeigniter


have character \ in result of rest service using CodeIgniter


i create post method :
class login extends REST_Controller {
function user_post() {
$re = array (
'code' => '0',
'result' => "loi roi",
'data' => "lp cp",
);
$this->response(json_encode($re));
}
}
after use WebRequest in c#, i have this string :
"{\"code\":\"0\",\"result\":\"loi roi\",\"data\":\"lp cp\"}"
but the string i want:
{"code":"0","result":"loi roi","data\":"lp cp"}
why have character in result ?
You seem to be double encoding a json object. Your REST_Controller::response method will encode what you give it to if the output format is json (assuming you are using this library). Just drop the json_encode() before you pass the $re.

Related Links

Unable to get any $_POST data from any form
Site URL CodeIgniter Not Working
Links not clickabe in CodeIgniter 3.0.3
codeigniter - Flashdata not clearing
WHERE in groceryCRUD
How to implement Braintree payment gateway in Codeigniter?
How to use x-editable with CodeIgniter?
Custom Error Message Does Not Display When Redirected If Session Expire
Multi Image upload with Grocery CRUD and Codeigniter
Why base_url() is returning invalid url?
How to do through routing in Codeigniter?
How to pass data to view and Load view into a variable
codeigniter Different/separate 404 page for frontend and backend
php code to select and echo image from database in codeignitter
what is question mark means in the url in php codeigniter framework
CodeIgniter - Load language globally (not by file but by folder)

Categories

HOME
typescript
flutter
groovy
clojure
vr
configuration
order
genetic-algorithm
box
microsoft-dynamics
akka.net
zipfile
superfish
research
calayer
light-inject
openui5
vscode-settings
image-gallery
lazy-loading
spring-restdocs
cayley
realm-java
jet
nested-set-model
aspdotnetstorefront
robotium
ratchet-2
abstract-syntax-tree
stylesheet
mathdotnet
ucwa
opensuse
mobile-center
breakpoint-sass
scom
reed-solomon
haxm
jformattedtextfield
mask
folly
perl-module
compass-lucene
procobol
textangular
permgen
php-deployer
gretl
psycopg2
domdocument
orchestrate
database-cleaner
biological-neural-network
angular-directive
graph-traversal
asp.net-mvc-custom-filter
android-sdk-tools
informatica-cloud
sound-synthesis
measurement-protocol
xnamespace
texture2d
geneos
target-platform
ota
vsvim
sliding
quasar
rdotnet
equinox
sketching
xerces
pencilblue
directcompute
fig
sirtrevor
preon
re2c
pligg
datapump
xcode4.2
jflow
icon-fonts
eject
vote
hiphop
ariatemplates
oledbcommand
hpple
c++builder-xe2
process.start
sdl.net
replay
mkreversegeocoder
nscollectionviewitem
cassandra-0.7
ryz
iequalitycomparer
dynamic-websites
palm-pre

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App