Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #9513
| Message-ID | <2336919.POkQNuqQtL@PointedEars.de> (permalink) |
|---|---|
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
| Organization | PointedEars Software (PES) |
| Date | 2013-05-22 00:32 +0200 |
| Subject | Re: values not changing |
| Newsgroups | comp.lang.php |
| References | <14jsq8i4oxkxn.r427ym6k6zgn$.dlg@40tude.net> <kngo8r$e55$5@dont-email.me> <2898756.xqxexv6urH@PointedEars.de> |
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
Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
values not changing richard <noreply@example.com> - 2013-05-21 14:17 -0400
Re: values not changing Christoph Becker <cmbecker69@gmx.de> - 2013-05-21 20:45 +0200
Re: values not changing Denis McMahon <denismfmcmahon@gmail.com> - 2013-05-21 21:17 +0000
Re: values not changing Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-05-22 00:22 +0200
Re: values not changing Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-05-22 00:30 +0200
Re: values not changing Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-05-22 00:32 +0200
Re: values not changing Doug Miller <doug_at_milmac_dot_com@example.com> - 2013-05-21 22:23 +0000
Re: values not changing "Peter H. Coffin" <hellsop@ninehells.com> - 2013-05-21 21:46 -0500
Re: values not changing richard <noreply@example.com> - 2013-05-21 23:40 -0400
Re: values not changing Doug Miller <doug_at_milmac_dot_com@example.com> - 2013-05-22 10:34 +0000
Re: values not changing Scott Johnson <noonehome@chalupasworld.com> - 2013-05-22 05:41 -0700
Re: values not changing David Robley <me@home.invalid> - 2013-05-22 10:02 +0930
csiph-web