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 求差集那个函数有问题,有无佬可以解决
  • ¥15 【提问】基于Invest的水源涵养
  • ¥20 微信网友居然可以通过vx号找到我绑的手机号
  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名
  • ¥65 汇编语言除法溢出问题