{"id":1334,"date":"2022-08-30T15:15:40","date_gmt":"2022-08-30T15:15:40","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/10\/json_encode-in-eclipse-php-causes-call-to-undefined-function-json_encode-error-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:15:40","modified_gmt":"2022-08-30T15:15:40","slug":"json_encode-in-eclipse-php-causes-call-to-undefined-function-json_encode-error-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/json_encode-in-eclipse-php-causes-call-to-undefined-function-json_encode-error-collection-of-common-programming-errors\/","title":{"rendered":"json_encode() in eclipse php causes Call to undefined function json_encode() error-Collection of common programming errors"},"content":{"rendered":"<p>I have created a php project in the eclipse pdt. When I attempt to call java_encode, I get a &#8220;Call to undefined function json_encode()&#8221; error. Other functions in the PDT&#8217;s php core api do not do this.<\/p>\n<p>Here is a code<\/p>\n<pre><code>$arr = array('a' =&gt; 1, 'b' =&gt; 2, 'c' =&gt; 3, 'd' =&gt; 4, 'e' =&gt; 5);\necho json_encode($arr);\n<\/code><\/pre>\n<p>The second line causes the error. Do I need an include or require? I am new to using json with the eclipse PDT. Help is needed. Thank you!<\/p>\n<p id=\"rop\"><small>Originally posted 2013-11-10 00:17:35. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>I have created a php project in the eclipse pdt. When I attempt to call java_encode, I get a &#8220;Call to undefined function json_encode()&#8221; error. Other functions in the PDT&#8217;s php core api do not do this. Here is a code $arr = array(&#8216;a&#8217; =&gt; 1, &#8216;b&#8217; =&gt; 2, &#8216;c&#8217; =&gt; 3, &#8216;d&#8217; =&gt; 4, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1334","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1334","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=1334"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1334\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=1334"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=1334"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=1334"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}