I’m making an attempt to indicate picture in my wordpress web site which get from third-party. They offer me uncooked information of picture. For showimg picture, I have to convert uncooked information(which get from third-party) to base64_encode
. It was working completely however not too long ago obtained an error with a particular picture. For all different picture is working completely.
I’ve debug and located the problem was create for base64_encode($file)
.
My Code :
$file = "picture uncooked information which get kind third-party";
$kind = "picture kind"; // png, jpg, jpeg
$en_data = base64_encode($file);
<img src="information:picture/<?=$kind;?>;base64, <?= $en_data; ?> ">
Error :
Deadly error: Uncaught TypeError: rely(): Argument #1 ($worth) should be
of kind Countable|array, bool given in
E:xampphtdocsdevwp-includesformatting.php:3415 Stack hint: #0
E:xampphtdocsdevwp-includesclass-wp-hook.php(307):
convert_smilies(‘rn<fashion kind=”…’) #1
E:xampphtdocsdevwp-includesplugin.php(191):
WP_Hook->apply_filters(‘rn<fashion kind=”…’, Array) #2
E:xampphtdocsdevwp-includespost-template.php(253):
apply_filters(‘the_content’, ‘<!– wp:shortco…’) #3
E:xampphtdocsdevwp-contentpluginsmy-pluginpagetemplatepage_fullwidth-template.php(11):
the_content() #4
E:xampphtdocsdevwp-includestemplate-loader.php(106):
embrace(‘E:xampphtdocs…’) #5
E:xampphtdocsdevwp-blog-header.php(19):
require_once(‘E:xampphtdocs…’) #6
E:xampphtdocsdevindex.php(17): require(‘E:xampphtdocs…’) #7
{fundamental} thrown in E:xampphtdocsdevwp-includesformatting.php on
line 3415There was a crucial error on this web site.
Thanks prematurely