Ask a Question related to PHP Development, Design and Development.
-
Ragnar #1
parse error, unexpected ':'
I have a code to parse feeds and i have a problem with a tag
<itms:coverArt>
i've tried to put a \ or to remove it from the php like this
itms.':'.coverArt but then there is no data displaying.
Has anyone any ideas?
the code <img border="0" src='.$rs[itms:coverArt].' width="50">
and it gets the content from a script using this
var $itemtags = array('itms:artist','itms:album', 'link', 'author',
'category', 'itms:albumLink','itms:coverArt','comments', 'enclosure',
'guid', 'pubDate', 'source','itms:albumPrice');
thanks
Ragnar Guest
-
PHP Parse error: parse error, unexpected t_string
Thanks for your advice. It was a painstaking exercise and highly frustrating not being able to start Live data. Peter Kamstra -
#25256 [Opn->Bgs]: Parse error: parse error, unexpected $ in ... on line 642
ID: 25256 Updated by: iliaa@php.net Reported By: a dot schat at streamedge dot com -Status: Open +Status: ... -
#25256 [Bgs->Opn]: Parse error: parse error, unexpected $ in ... on line 642
ID: 25256 User updated by: a dot schat at streamedge dot com Reported By: a dot schat at streamedge dot com -Status: ... -
#25256 [NEW]: Parse error: parse error, unexpected $ in ... on line 642
From: a dot schat at streamedge dot com Operating system: Linux PHP version: 4.3.1 PHP Bug Type: Compile Failure Bug... -
parse error, unexpected T_STRING
in the line "include(sign.php);" the file name should be in quotes; like include("sign.php"); hth Kurt Milligan sky2070 wrote: -
Alvaro #2
Re: parse error, unexpected ':'
*** Ragnar wrote/escribió (Wed, 27 Oct 2004 13:05:48 +0200):
It's fine that you copy a code excerpt, but you should copy at least a
complete sentence.
Given that the complete code reads something like this:
echo '<img border="0" src='.$rs[itms:coverArt].' width="50">';
Arrays in PHP accept two types of indexes, integers or strings. E.G.
echo $rs[0];
echo $rs['bar'];
$foo=0; echo $rs[$foo];
$foo='bar'; echo $rs[$foo];
define('foo', 0); echo $rs[$foo];
define('foo', 'bar'); echo $rs[$foo];
What's itms:coverArt supposed to be?
--
-- Álvaro G. Vicario - Burgos, Spain
-- Thank you for not e-mailing me your questions
--
Alvaro Guest
-
Ragnar #3
Re: parse error, unexpected ':'
On 2004-10-27 13:51:08 +0200, Alvaro G Vicario
<com> said:
>
> It's fine that you copy a code excerpt, but you should copy at least a
> complete sentence.
>
> Given that the complete code reads something like this:
>
> echo '<img border="0" src='.$rs[itms:coverArt].' width="50">';
>
> Arrays in PHP accept two types of indexes, integers or strings. E.G.
>
> echo $rs[0];
> echo $rs['bar'];
> $foo=0; echo $rs[$foo];
> $foo='bar'; echo $rs[$foo];
> define('foo', 0); echo $rs[$foo];
> define('foo', 'bar'); echo $rs[$foo];
>
>
> What's itms:coverArt supposed to be?
>
>
> -- -- Álvaro G. Vicario - Burgos, Spain
> -- Thank you for not e-mailing me your questions
> --
>[/ref]
itms:coverArt is from a rss feed but udually they are formatted like this
<item>text</item> and not like this <item:stuff>text</item:stuff> and while
using the latest it gives a parse error
Ragnar Guest
-
Ragnar #4
Re: parse error, unexpected ':'
On 2004-10-27 13:51:08 +0200, Alvaro G Vicario
<com> said:
>
> It's fine that you copy a code excerpt, but you should copy at least a
> complete sentence.
>
> Given that the complete code reads something like this:
>
> echo '<img border="0" src='.$rs[itms:coverArt].' width="50">';
>
> Arrays in PHP accept two types of indexes, integers or strings. E.G.
>
> echo $rs[0];
> echo $rs['bar'];
> $foo=0; echo $rs[$foo];
> $foo='bar'; echo $rs[$foo];
> define('foo', 0); echo $rs[$foo];
> define('foo', 'bar'); echo $rs[$foo];
>
>
> What's itms:coverArt supposed to be?
>
>
> -- -- Álvaro G. Vicario - Burgos, Spain
> -- Thank you for not e-mailing me your questions
> --
>[/ref]
itms:coverArt id from a rss feed and usually they use another format as
<item>text</item> but this one uses <item:stuff>text</item:stuff> and using
this gives a parse error.
Ragnar Guest
-
Alvaro #5
Re: parse error, unexpected ':'
*** Alvaro G Vicario wrote/escribió (Wed, 27 Oct 2004 13:51:08 +0200):
Sorry, typo!
define('foo', 0); echo $rs[foo];
define('foo', 'bar'); echo $rs[foo];
--
-- Álvaro G. Vicario - Burgos, Spain
-- Thank you for not e-mailing me your questions
--
Alvaro Guest
-
Alvaro #6
Re: parse error, unexpected ':'
*** Ragnar wrote/escribió (Wed, 27 Oct 2004 13:59:45 +0200):
RSS is not PHP. Just can't just place it within your code :-?
--
-- Álvaro G. Vicario - Burgos, Spain
-- Thank you for not e-mailing me your questions
--
Alvaro Guest
-
Janwillem #7
Re: parse error, unexpected ':'
Ragnar wrote:
If you learned yourself to use quotes when accessing array keys, you
wouldn't have this problem:
NOT: $foo[key]
BUT: $foo['key']
NOT: $rs[itms:coverArt]
BUT: $rs['itms:coverArt']
Also read:
http://nl3.php.net/manual/en/language.types.array.php#language.types.array.dont s
JW
Janwillem Guest



Reply With Quote

