doulu4413
doulu4413
2016-12-06 16:54
浏览 165
已采纳

Php7.1致命错误:字符串不支持[]运算符[重复]

This question already has an answer here:

I built a some function theme option wordpress.

But I am receiving the following error now, what am I doing wrong?

  if(isset($thm_options['custom_font1_eot']))
    $w_custom_font1_src[] = "url('{$thm_options['custom_font1_eot']['url']}?#iefix') format('embedded-opentype')";

  if(isset($thm_options['custom_font1_woff']))   
    $w_custom_font1_src[] = "url('{$thm_options['custom_font1_woff']['url']}') format('woff')";

  if(isset($thm_options['custom_font1_ttf']))
    $w_custom_font1_src[] = "url('{$thm_options['custom_font1_ttf']['url']}') format('truetype')";

Fatal error: [] operator not supported for strings in

Anything I missed code?

</div>

图片转代码服务由CSDN问答提供 功能建议

此问题已经存在 这里有一个答案:

  • 致命错误:for循环中的PHP数组上的字符串错误不支持[]运算符 2 answers

    我构建了一个功能主题选项wordpress。

    但是我现在收到以下错误,我做错了什么?

      if(isset($ thm_options ['custom_font1_eot']))
     $ w_custom_font1_src [] =“url('{$ thm_options ['custom_font1_eot'] ['url']}?#iefix')format('  embedded-opentype')“; 
     
     if(isset($ thm_options ['custom_font1_woff']))
     $ w_custom_font1_src [] =”url('{$ thm_options ['custom)  _font1_woff'] ['url']}')format('woff')“; 
     
     if(isset($ thm_options ['custom_font1_ttf']))
     $ w_custom_font1_src [] =”url('{$ thm_options  ['custom_font1_ttf'] ['url']}')格式('truetype')“; 
       
     
     

    致命错误:[]运算符不 中的字符串是否支持

    我错过了什么代码?

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • duanji9677
    duanji9677 2016-12-06 17:01
    已采纳

    You may have used this variable $w_custom_font1_src as a string somewhere else in the program.

    So now reinitialize as an array

     $w_custom_font1_src =  array();
    
    点赞 评论

相关推荐