P.S I'm a newbie in codeigniter and searched for answers but its far beyond my comprehension so I will ask this question for my level.

I just found this code for a dynamic breadcrumb helper in youtube and I am receiving an error. Can you guys help me debug it? Cause I'm confuse with his code but its an efficient one cause you just simply echo the function in VIEW.
This is the error:

> 
> A PHP Error was encountered
> 
> 
> Severity: Parsing Error
> 
> 
> Message: syntax error, unexpected ';'
> 
> 
> Filename: helpers/breadcrumb\_helper.php
> 
> 
> Line Number: 15
> 
> 
> Backtrace:
> 
> 
> 

Here is the code

```
    <?php
if(!function_exists('generatedBreadcrumb')){
    function generateBreadcrumb(){
        $ci=&get_instance();
        $i=1;
        $iro = $ci->iri->segment($i);
        $link='
        <div class="pageheader">
        <h2><i class="fa fa-edit"></i>'.$ci->uri->segment($i).'</h2>
        <div class="breadcrumb-wrapper">

        <ol class="breadcrumb">';

        while($uri != "){
        $prep_link = ";
        $for($j=1; $j<=$i; $j++){
        $prep_link.=$ci->uri->segment($j).'/';
        }

        if($ci->uri->segment($i+1)=="){
            $link.='<li class="active"><a href=".site_uri($prep_link).">';
            $link.=$ci->uri->segment($i).'</a></li>';
        }else{
            $link.='<li><a href=."site_url($prep_link).">';
            $link.=$ci->uri->segment($i).'</a><span class="divider"></span></li>';
        }

        $i++;
        $uri = $ci->uri->segment($i);
        }
        $link .='</ol></div></div>';
        return $link;
        }
        }

```