FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » values not changing
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: values not changing [message #181565 is a reply to message #181564] Tue, 21 May 2013 22:32 Go to previous messageGo to previous message
Thomas 'PointedEars'  is currently offline  Thomas 'PointedEars'
Messages: 701
Registered: October 2010
Karma:
Senior Member
Thomas 'PointedEars' Lahn wrote:

> Assuming JSON, it is much better (if not even the only *correct* way) to
> write
>
> echo json_encode(array(
> 'image' => '',
> 'title' => $vid[0],
> 'file' => "http://www.youtube.com/watch?v={$vid[2]}",
> 'description' => "{$year} # {$number} - {$vid[1]}"
> ));
>
> Because you cannot simply insert arbitrary strings in a generated string
> literal and hope the outcome will be correct JSON; *at least* you would
> have to escape slashes in the inserted strings, and you do not have to do
^ with back-
> that by yourself if you use json_encode() in the first place. AISB.

--
realism: HTML 4.01 Strict
evangelism: XHTML 1.0 Strict
madness: XHTML 1.1 as application/xhtml+xml
-- Bjoern Hoehrmann
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: insert PDF table in database
Next Topic: Got it working finally
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 30 11:59:55 GMT 2024

Total time taken to generate the page: 0.04137 seconds