<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>webcyclus &#187; ESE</title>
	<atom:link href="http://webcyclus.de/category/ese/feed/" rel="self" type="application/rss+xml" />
	<link>http://webcyclus.de</link>
	<description></description>
	<lastBuildDate>Tue, 07 Sep 2010 05:20:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>PHP: Parse error: parse error, unexpected T_NEW</title>
		<link>http://webcyclus.de/php-parse-error-parse-error-unexpected-t_new/</link>
		<comments>http://webcyclus.de/php-parse-error-parse-error-unexpected-t_new/#comments</comments>
		<pubDate>Sat, 16 Jan 2010 14:07:46 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[ESE]]></category>

		<guid isPermaLink="false">http://webcyclus.de/?p=4114</guid>
		<description><![CDATA[Die Fehlermeldung Parse error: parse error, unexpected T_NEW Tritt meistens auf wenn man versucht ein neues Objekt zu erstellen und ein Gleichzeichen vergessen wird. Fehlermeldung: Parse error: parse error, unexpected T_NEW Um den Fehler zu vermeiden sollte stets darauf geachtet werden das die Zuweisung von neuen Objekten richtig gemacht wird. Verwandte Artikel:PHP: Parse error: parse [...]


Verwandte Artikel:<a href='http://webcyclus.de/php-parse-error-parse-error-unexpected/' rel='bookmark' title='Permanent Link: PHP: Parse error: parse error, unexpected &#8216;<&#8216; in'>PHP: Parse error: parse error, unexpected &#8216;<&#8216; in</a><a href='http://webcyclus.de/php-parse-error-parse-error-unexpected-t_lnumber/' rel='bookmark' title='Permanent Link: PHP: Parse error: parse error, unexpected T_LNUMBER'>PHP: Parse error: parse error, unexpected T_LNUMBER</a><a href='http://webcyclus.de/php-the-second-argument-should-be-either-an-array-or-an-object/' rel='bookmark' title='Permanent Link: PHP: The second argument should be either an array or an object'>PHP: The second argument should be either an array or an object</a>]]></description>
			<content:encoded><![CDATA[<p>Die Fehlermeldung <strong>Parse error: parse error, unexpected T_NEW</strong> Tritt meistens auf wenn man versucht ein neues Objekt zu erstellen und ein Gleichzeichen vergessen wird.</p>
<p><strong>Fehlermeldung:</strong></p>
<p>Parse error: parse error, unexpected T_NEW</p>
<p>Um den Fehler zu vermeiden sollte stets darauf geachtet werden das die Zuweisung von neuen Objekten richtig gemacht wird.</p>


<p>Verwandte Artikel:</p><a href='http://webcyclus.de/php-parse-error-parse-error-unexpected/' rel='bookmark' title='Permanent Link: PHP: Parse error: parse error, unexpected &#8216;<&#8216; in'>PHP: Parse error: parse error, unexpected &#8216;<&#8216; in</a><br /><a href='http://webcyclus.de/php-parse-error-parse-error-unexpected-t_lnumber/' rel='bookmark' title='Permanent Link: PHP: Parse error: parse error, unexpected T_LNUMBER'>PHP: Parse error: parse error, unexpected T_LNUMBER</a><br /><a href='http://webcyclus.de/php-the-second-argument-should-be-either-an-array-or-an-object/' rel='bookmark' title='Permanent Link: PHP: The second argument should be either an array or an object'>PHP: The second argument should be either an array or an object</a><br /></p>]]></content:encoded>
			<wfw:commentRss>http://webcyclus.de/php-parse-error-parse-error-unexpected-t_new/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP: Warning: Invalid argument supplied for foreach()</title>
		<link>http://webcyclus.de/php-warning-invalid-argument-supplied-for-foreach/</link>
		<comments>http://webcyclus.de/php-warning-invalid-argument-supplied-for-foreach/#comments</comments>
		<pubDate>Sat, 16 Jan 2010 13:58:52 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[ESE]]></category>

		<guid isPermaLink="false">http://webcyclus.de/?p=4107</guid>
		<description><![CDATA[Der Fehler Warning: Invalid argument supplied for foreach() tritt bei der Verwendung der foreach() Schleife auf. Meistens liegt der Fehler darin das es sich bei dem benötigten Array nicht um ein Array handelt. Fehlermeldung: Warning: Invalid argument supplied for foreach() Beispiel &#8211; falsch $var = &#34;Ich bin ein Text&#34;; &#160; foreach&#40;$string as $output&#41; &#123; echo [...]


Verwandte Artikel:<a href='http://webcyclus.de/php-warning-fclose-supplied-argument-is-not-a-valid-stream-resource/' rel='bookmark' title='Permanent Link: PHP: Warning: fclose(): supplied argument is not a valid stream resource'>PHP: Warning: fclose(): supplied argument is not a valid stream resource</a><a href='http://webcyclus.de/php-the-second-argument-should-be-either-an-array-or-an-object/' rel='bookmark' title='Permanent Link: PHP: The second argument should be either an array or an object'>PHP: The second argument should be either an array or an object</a><a href='http://webcyclus.de/php-foreach-schleife/' rel='bookmark' title='Permanent Link: PHP &#8211; foreach-Schleife'>PHP &#8211; foreach-Schleife</a>]]></description>
			<content:encoded><![CDATA[<p>Der Fehler <strong>Warning: Invalid argument supplied for foreach()</strong> tritt bei der Verwendung der <strong>foreach() </strong>Schleife auf. Meistens liegt der Fehler darin das es sich bei dem benötigten Array nicht um ein Array handelt. </p>
<p><strong>Fehlermeldung:</strong></p>
<p>Warning: Invalid argument supplied for foreach()</p>
<p><strong>Beispiel &#8211; falsch</strong></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$var</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;Ich bin ein Text&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$string</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$output</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
 <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$output</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Da es sich im obigen Beispiel nicht um Array handelt wird der Fehler ausgeworfen. Um diesen Fehler zu vermeiden könnte vor der Abarbeitung der Schleife geprüft werden ob es sich hierbei überhaupt um ein Array handelt. Hierzu eignet sich die Funktion <strong>is_array()</strong>.</p>


<p>Verwandte Artikel:</p><a href='http://webcyclus.de/php-warning-fclose-supplied-argument-is-not-a-valid-stream-resource/' rel='bookmark' title='Permanent Link: PHP: Warning: fclose(): supplied argument is not a valid stream resource'>PHP: Warning: fclose(): supplied argument is not a valid stream resource</a><br /><a href='http://webcyclus.de/php-the-second-argument-should-be-either-an-array-or-an-object/' rel='bookmark' title='Permanent Link: PHP: The second argument should be either an array or an object'>PHP: The second argument should be either an array or an object</a><br /><a href='http://webcyclus.de/php-foreach-schleife/' rel='bookmark' title='Permanent Link: PHP &#8211; foreach-Schleife'>PHP &#8211; foreach-Schleife</a><br /></p>]]></content:encoded>
			<wfw:commentRss>http://webcyclus.de/php-warning-invalid-argument-supplied-for-foreach/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP: Warning: fclose(): supplied argument is not a valid stream resource</title>
		<link>http://webcyclus.de/php-warning-fclose-supplied-argument-is-not-a-valid-stream-resource/</link>
		<comments>http://webcyclus.de/php-warning-fclose-supplied-argument-is-not-a-valid-stream-resource/#comments</comments>
		<pubDate>Sat, 16 Jan 2010 13:46:05 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[ESE]]></category>

		<guid isPermaLink="false">http://webcyclus.de/?p=4105</guid>
		<description><![CDATA[Die Fehlermeldung Warning: fclose(): supplied argument is not a valid stream resource tritt meistens dann auf wenn gar keine Datei mit fopen() geöffnet wurde. Fehlermeldung: Warning: fclose(): supplied argument is not a valid stream resource Es sollte erstmal überprüft werden ob überhaupt eine Datei geöffnet bzw. ob die Datei erfolgreich geöffnet wurde. Ist dieses der [...]


Verwandte Artikel:<a href='http://webcyclus.de/php-warning-invalid-argument-supplied-for-foreach/' rel='bookmark' title='Permanent Link: PHP: Warning: Invalid argument supplied for foreach()'>PHP: Warning: Invalid argument supplied for foreach()</a><a href='http://webcyclus.de/php-warning-fopen-failed-to-open-stream-permission-denied/' rel='bookmark' title='Permanent Link: PHP: Warning: fopen: failed to open stream: Permission denied'>PHP: Warning: fopen: failed to open stream: Permission denied</a><a href='http://webcyclus.de/php-the-second-argument-should-be-either-an-array-or-an-object/' rel='bookmark' title='Permanent Link: PHP: The second argument should be either an array or an object'>PHP: The second argument should be either an array or an object</a>]]></description>
			<content:encoded><![CDATA[<p>Die Fehlermeldung <strong>Warning: fclose(): supplied argument is not a valid stream resource</strong> tritt meistens dann auf wenn gar keine Datei mit <strong>fopen()</strong> geöffnet wurde.</p>
<p><strong>Fehlermeldung:</strong></p>
<p>Warning: fclose(): supplied argument is not a valid stream resource</p>
<p>Es sollte erstmal überprüft werden ob überhaupt eine Datei geöffnet bzw. ob die Datei erfolgreich geöffnet wurde. Ist dieses der Fall kann die Datei auch via <strong>fclose() </strong>geschlossen werden.</p>


<p>Verwandte Artikel:</p><a href='http://webcyclus.de/php-warning-invalid-argument-supplied-for-foreach/' rel='bookmark' title='Permanent Link: PHP: Warning: Invalid argument supplied for foreach()'>PHP: Warning: Invalid argument supplied for foreach()</a><br /><a href='http://webcyclus.de/php-warning-fopen-failed-to-open-stream-permission-denied/' rel='bookmark' title='Permanent Link: PHP: Warning: fopen: failed to open stream: Permission denied'>PHP: Warning: fopen: failed to open stream: Permission denied</a><br /><a href='http://webcyclus.de/php-the-second-argument-should-be-either-an-array-or-an-object/' rel='bookmark' title='Permanent Link: PHP: The second argument should be either an array or an object'>PHP: The second argument should be either an array or an object</a><br /></p>]]></content:encoded>
			<wfw:commentRss>http://webcyclus.de/php-warning-fclose-supplied-argument-is-not-a-valid-stream-resource/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP: Parse error: parse error, unexpected &#8216;</title>
		<link>http://webcyclus.de/php-parse-error-parse-error-unexpected/</link>
		<comments>http://webcyclus.de/php-parse-error-parse-error-unexpected/#comments</comments>
		<pubDate>Sat, 16 Jan 2010 13:41:40 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[ESE]]></category>

		<guid isPermaLink="false">http://webcyclus.de/?p=4101</guid>
		<description><![CDATA[Der Fehler Parse error: parse error, unexpected &#8216;


Verwandte Artikel:<a href='http://webcyclus.de/php-parse-error-parse-error-unexpected-t_new/' rel='bookmark' title='Permanent Link: PHP: Parse error: parse error, unexpected T_NEW'>PHP: Parse error: parse error, unexpected T_NEW</a><a href='http://webcyclus.de/php-parse-error-parse-error-unexpected-t_lnumber/' rel='bookmark' title='Permanent Link: PHP: Parse error: parse error, unexpected T_LNUMBER'>PHP: Parse error: parse error, unexpected T_LNUMBER</a><a href='http://webcyclus.de/php-warning-invalid-argument-supplied-for-foreach/' rel='bookmark' title='Permanent Link: PHP: Warning: Invalid argument supplied for foreach()'>PHP: Warning: Invalid argument supplied for foreach()</a>]]></description>
			<content:encoded><![CDATA[<p>Der Fehler <strong>Parse error: parse error, unexpected &#8216;<' in</strong tritt meistens auf wenn mehrere PHP Bereiche geöffnet werden ohne jeden einzelnen zu schließen.</p>
<p><strong>Fehlermeldung:</strong></p>
<p>Parse error: parse error, unexpected &#8216;<' in</p>
<p><strong>Beispiel &#8211; falsch</strong></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
 <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'Erster Bereich'</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">&lt;?php</span> 
 <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'Zweiter Bereich'</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Um dieses zu vermeiden muss ständig darauf geachtet werden das jeder PHP geschlossen wird, da es ansonsten zu dem oben genannten Fehler kommt.</p>


<p>Verwandte Artikel:</p><a href='http://webcyclus.de/php-parse-error-parse-error-unexpected-t_new/' rel='bookmark' title='Permanent Link: PHP: Parse error: parse error, unexpected T_NEW'>PHP: Parse error: parse error, unexpected T_NEW</a><br /><a href='http://webcyclus.de/php-parse-error-parse-error-unexpected-t_lnumber/' rel='bookmark' title='Permanent Link: PHP: Parse error: parse error, unexpected T_LNUMBER'>PHP: Parse error: parse error, unexpected T_LNUMBER</a><br /><a href='http://webcyclus.de/php-warning-invalid-argument-supplied-for-foreach/' rel='bookmark' title='Permanent Link: PHP: Warning: Invalid argument supplied for foreach()'>PHP: Warning: Invalid argument supplied for foreach()</a><br /></p>]]></content:encoded>
			<wfw:commentRss>http://webcyclus.de/php-parse-error-parse-error-unexpected/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP: Parse error: parse error, unexpected T_LNUMBER</title>
		<link>http://webcyclus.de/php-parse-error-parse-error-unexpected-t_lnumber/</link>
		<comments>http://webcyclus.de/php-parse-error-parse-error-unexpected-t_lnumber/#comments</comments>
		<pubDate>Sat, 16 Jan 2010 13:34:38 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[ESE]]></category>

		<guid isPermaLink="false">http://webcyclus.de/?p=4096</guid>
		<description><![CDATA[Die Fehlermeldung Parse error: parse error, unexpected T_LNUMBER tritt auf wenn ein Hochkomma in einem String nicht excaped bzw. geschützt wird. Beispiel &#8211; falsch $var = &#34;Sie sagte: &#34;Das die Welt schön ist&#34;; Hier sieht man das der eigentliche String schon bei Sie sagte: abgeschnitten wird und der Rest wirft den Fehler aus da der [...]


Verwandte Artikel:<a href='http://webcyclus.de/php-parse-error-parse-error-unexpected-t_new/' rel='bookmark' title='Permanent Link: PHP: Parse error: parse error, unexpected T_NEW'>PHP: Parse error: parse error, unexpected T_NEW</a><a href='http://webcyclus.de/php-parse-error-parse-error-unexpected/' rel='bookmark' title='Permanent Link: PHP: Parse error: parse error, unexpected &#8216;<&#8216; in'>PHP: Parse error: parse error, unexpected &#8216;<&#8216; in</a><a href='http://webcyclus.de/php-text-ausgabe-mit-php/' rel='bookmark' title='Permanent Link: PHP &#8211; Text Ausgabe mit PHP'>PHP &#8211; Text Ausgabe mit PHP</a>]]></description>
			<content:encoded><![CDATA[<p>Die Fehlermeldung <strong>Parse error: parse error, unexpected T_LNUMBER</strong> tritt auf wenn ein Hochkomma in einem String nicht excaped bzw. geschützt wird.</p>
<p><strong>Beispiel &#8211; falsch</strong></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$var</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;Sie sagte: &quot;</span>Das <span style="color: #990000;">die</span> Welt schön ist<span style="color: #0000ff;">&quot;;</span></pre></div></div>

<p>Hier sieht man das der eigentliche String schon bei <b>Sie sagte:</b> abgeschnitten wird und der Rest wirft den Fehler aus da der String nicht beendet wird. Um diesen Fehler zu vermeiden müssen die Hochkommas oder auch Anführungszeichen excaped werden. Dieses wird mit einem Backslash gemacht.</p>
<p><strong>Beispiel &#8211; richtig</strong></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$var</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;Sie sagte: <span style="color: #000099; font-weight: bold;">\&quot;</span>Das die Welt schön ist<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span><span style="color: #339933;">;</span></pre></div></div>



<p>Verwandte Artikel:</p><a href='http://webcyclus.de/php-parse-error-parse-error-unexpected-t_new/' rel='bookmark' title='Permanent Link: PHP: Parse error: parse error, unexpected T_NEW'>PHP: Parse error: parse error, unexpected T_NEW</a><br /><a href='http://webcyclus.de/php-parse-error-parse-error-unexpected/' rel='bookmark' title='Permanent Link: PHP: Parse error: parse error, unexpected &#8216;<&#8216; in'>PHP: Parse error: parse error, unexpected &#8216;<&#8216; in</a><br /><a href='http://webcyclus.de/php-text-ausgabe-mit-php/' rel='bookmark' title='Permanent Link: PHP &#8211; Text Ausgabe mit PHP'>PHP &#8211; Text Ausgabe mit PHP</a><br /></p>]]></content:encoded>
			<wfw:commentRss>http://webcyclus.de/php-parse-error-parse-error-unexpected-t_lnumber/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP: Warning: fopen: failed to open stream: Permission denied</title>
		<link>http://webcyclus.de/php-warning-fopen-failed-to-open-stream-permission-denied/</link>
		<comments>http://webcyclus.de/php-warning-fopen-failed-to-open-stream-permission-denied/#comments</comments>
		<pubDate>Sat, 16 Jan 2010 13:28:01 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[ESE]]></category>

		<guid isPermaLink="false">http://webcyclus.de/?p=4085</guid>
		<description><![CDATA[Bei der Fehlermeldung Warning: fopen: failed to open stream: Permission denied liegt das Problem beim Öffnen einer Datei. Dieses kann verschiedene Gründe haben, entweder hat man keine Berechtigungen, beschätigte Datei oder welche Gründe auch immer. Fehlermeldung: Warning: fopen: failed to open stream: Permission denied Ursachen: Die Ursache für diese Fehlermeldung ist wie oben schon genannt [...]


Verwandte Artikel:<a href='http://webcyclus.de/php-warning-fclose-supplied-argument-is-not-a-valid-stream-resource/' rel='bookmark' title='Permanent Link: PHP: Warning: fclose(): supplied argument is not a valid stream resource'>PHP: Warning: fclose(): supplied argument is not a valid stream resource</a><a href='http://webcyclus.de/php-warning-invalid-argument-supplied-for-foreach/' rel='bookmark' title='Permanent Link: PHP: Warning: Invalid argument supplied for foreach()'>PHP: Warning: Invalid argument supplied for foreach()</a><a href='http://webcyclus.de/open-office-writer-querformat/' rel='bookmark' title='Permanent Link: Open Office Writer Querformat'>Open Office Writer Querformat</a>]]></description>
			<content:encoded><![CDATA[<p>Bei der Fehlermeldung <strong>Warning: fopen: failed to open stream: Permission denied</strong> liegt das Problem beim Öffnen einer Datei. Dieses kann verschiedene Gründe haben, entweder hat man keine Berechtigungen, beschätigte Datei oder welche Gründe auch immer.</p>
<p><strong>Fehlermeldung:</strong></p>
<p>Warning: fopen: failed to open stream: Permission denied</p>
<p><strong>Ursachen:</strong></p>
<p>Die Ursache für diese Fehlermeldung ist wie oben schon genannt das die Datei nicht gelesen werden kann.<br />
Um auszuschließen das es an den Berechtigungen liegt müssen die Zugriffsrechte auf diese Datei via CHMOD geändert werden, sodass die Datei gelesen bzw. beschrieben werden kann. Liegt es nicht an den Berechtigen sollte vorher überprüft werden ob die Datei über existiert. Hierzu können die Funktionen <strong>file_exists()</strong> verwendet werden. Wer sicher gehen will kann auch noch überprüfen ob die Datei beschreibbar oder lesbar ist, dazu eignen sich die Funktion <strong>is_writeable()</strong> oder <strong>is_readable()</strong>.</p>


<p>Verwandte Artikel:</p><a href='http://webcyclus.de/php-warning-fclose-supplied-argument-is-not-a-valid-stream-resource/' rel='bookmark' title='Permanent Link: PHP: Warning: fclose(): supplied argument is not a valid stream resource'>PHP: Warning: fclose(): supplied argument is not a valid stream resource</a><br /><a href='http://webcyclus.de/php-warning-invalid-argument-supplied-for-foreach/' rel='bookmark' title='Permanent Link: PHP: Warning: Invalid argument supplied for foreach()'>PHP: Warning: Invalid argument supplied for foreach()</a><br /><a href='http://webcyclus.de/open-office-writer-querformat/' rel='bookmark' title='Permanent Link: Open Office Writer Querformat'>Open Office Writer Querformat</a><br /></p>]]></content:encoded>
			<wfw:commentRss>http://webcyclus.de/php-warning-fopen-failed-to-open-stream-permission-denied/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP: The second argument should be either an array or an object</title>
		<link>http://webcyclus.de/php-the-second-argument-should-be-either-an-array-or-an-object/</link>
		<comments>http://webcyclus.de/php-the-second-argument-should-be-either-an-array-or-an-object/#comments</comments>
		<pubDate>Sat, 16 Jan 2010 13:09:20 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[ESE]]></category>

		<guid isPermaLink="false">http://webcyclus.de/?p=4069</guid>
		<description><![CDATA[Die Fehlermeldung The second argument should be either an array or an object tritt meistens bei der Verwendung von array_key_exists() auf. Fehlermeldung: Warning: array_key_exists(): The second argument should be either an array or an object in y on line x. Beispiel &#8211; falsch: if&#40;array_key_exists&#40;'keyword', $array&#41;&#41;&#123; echo 'Der Suchbegriff ist im Array vorhanden'; &#125; Ist in [...]


Verwandte Artikel:<a href='http://webcyclus.de/php-warning-invalid-argument-supplied-for-foreach/' rel='bookmark' title='Permanent Link: PHP: Warning: Invalid argument supplied for foreach()'>PHP: Warning: Invalid argument supplied for foreach()</a><a href='http://webcyclus.de/php-warning-fclose-supplied-argument-is-not-a-valid-stream-resource/' rel='bookmark' title='Permanent Link: PHP: Warning: fclose(): supplied argument is not a valid stream resource'>PHP: Warning: fclose(): supplied argument is not a valid stream resource</a><a href='http://webcyclus.de/php-array-durchsuchen/' rel='bookmark' title='Permanent Link: PHP &#8211; Array durchsuchen'>PHP &#8211; Array durchsuchen</a>]]></description>
			<content:encoded><![CDATA[<p>Die Fehlermeldung <strong>The second argument should be either an array or an object</strong> tritt meistens bei der Verwendung von <strong>array_key_exists()</strong> auf. </p>
<p><strong>Fehlermeldung:</strong></p>
<p>Warning: array_key_exists(): The second argument should be either an array or an object in y on line x.</p>
<p><strong>Beispiel &#8211; falsch:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array_key_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'keyword'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$array</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
   <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'Der Suchbegriff ist im Array vorhanden'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Ist in dem oberen Beispiel das <strong>$array</strong> kein Array wird die Fehlermeldung ausgeworfen. Um dieses zu verhindern kann man vor der Bedingung prüfen ob es sich hierbei wirklich um ein Array handelt. Hierzu eignet sich die Funktion <strong>is_array()</strong>.</p>
<p><strong>Beispiel &#8211; richtig:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">is_array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$array</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
   <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array_key_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'keyword'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$array</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
      <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'Der Suchbegriff ist im Array vorhanden'</span><span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>



<p>Verwandte Artikel:</p><a href='http://webcyclus.de/php-warning-invalid-argument-supplied-for-foreach/' rel='bookmark' title='Permanent Link: PHP: Warning: Invalid argument supplied for foreach()'>PHP: Warning: Invalid argument supplied for foreach()</a><br /><a href='http://webcyclus.de/php-warning-fclose-supplied-argument-is-not-a-valid-stream-resource/' rel='bookmark' title='Permanent Link: PHP: Warning: fclose(): supplied argument is not a valid stream resource'>PHP: Warning: fclose(): supplied argument is not a valid stream resource</a><br /><a href='http://webcyclus.de/php-array-durchsuchen/' rel='bookmark' title='Permanent Link: PHP &#8211; Array durchsuchen'>PHP &#8211; Array durchsuchen</a><br /></p>]]></content:encoded>
			<wfw:commentRss>http://webcyclus.de/php-the-second-argument-should-be-either-an-array-or-an-object/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
