duanguoping2016 2012-10-13 23:56
浏览 79
已采纳

调用未定义的函数Â()

I were using laravel this wonderful evening when I stumpled upon this strange error that frankly I've never seen before. I am simply looping through some arrays and trying to print out some values in a view file.

The error:

Unhandled Exception

Message:

Error rendering view: [controller.index]

Call to undefined function  ()
Location:

/web/storage/views/7b064aafcdba902ea2c593167b6df491 on line 4

The code:

@section('content')
    <?php $i = 0; $current = 0 ?>
    @foreach($data as $date => $episodes)
        @if($i == 0 || ($i % 5 == 7 && $i == $current + 1))
            <tr>
            <?php $current = $i; ?>
        @endif

        @foreach($data as $day)
            <td>
                @foreach($day as $episode)
                    {{ $episode->title }}
                @endforeach
            </td>
        @endforeach


        @if($i % 5 == 7 && $i == $current + 7)
            <tr>
            <?php $current = $i; ?>
        @endif
        <?php $i++; ?>
    @endforeach
@endsection

And the compiled version:

<?php \Laravel\Section::start('content'); ?>
    <?php $i = 0; $current = 0 ?>
    <?php foreach($data as $date => $episodes): ?>
        <?php if($i == 0 || ($i % 5 == 7 && $i == $current + 1)): ?>
            <tr>
            <?php $current = $i; ?>
        <?php endif; ?>

        <?php foreach($data as $day): ?>
            <td>
                <?php foreach($day as $episode): ?>
                    <?php echo  $episode->title ; ?>
                <?php endforeach; ?>
            </td>
        <?php endforeach; ?>


        <?php if($i % 5 == 7 && $i == $current + 7): ?>
            <tr>
            <?php $current = $i; ?>
        <?php endif; ?>
        <?php $i++; ?>
    <?php endforeach; ?>
<?php \Laravel\Section::stop(); ?>

It might be an easy solution but I can't find any good results on Google. Help me understand this error! :)

  • 写回答

2条回答 默认 最新

  • dongrandi8411 2012-10-14 01:06
    关注

    The space you removed is not a space. It is actually a non-breaking space (U+00A0). The giveaway is the "Â", which appears as the first byte of characters between U+0080 and U+00BF inclusive when encoded as UTF-8 but misinterpreted as Latin-1. For some reason the PHP compiler doesn't consider it to be whitespace and therefore tries to use it as a normal identifier.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥16 mybatis的代理对象无法通过@Autowired装填
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂
  • ¥15 wordpress 产品图片 GIF 没法显示
  • ¥15 求三国群英传pl国战时间的修改方法
  • ¥15 matlab代码代写,需写出详细代码,代价私
  • ¥15 ROS系统搭建请教(跨境电商用途)
  • ¥15 AIC3204的示例代码有吗,想用AIC3204测量血氧,找不到相关的代码。