title: Adding div inside long echo string php
body: <p>I'm trying to add a div inside this echo string, looked at all the other topics but this string is a bit more complex than the issues discussed there.</p>
  <p><strong>Whole code:</strong></p>
  <pre><code>          &lt;div class=&quot;breadcrumb hidden-xs&quot; typeof=&quot;BreadcrumbList&quot; vocab=&quot;https://schema.org/&quot;&gt;     
            &lt;span property=&quot;itemListElement&quot; typeof=&quot;ListItem&quot;&gt;&lt;a property=&quot;item&quot; typeof=&quot;WebPage&quot; class=&quot;home&quot; href=&quot;&lt;?php echo home_url('/');?&gt;&quot; title=&quot;&lt;?php echo bloginfo('name');?&gt;&quot;&gt;&lt;span property=&quot;name&quot;&gt;Home&lt;/span&gt;&lt;/a&gt;&lt;meta property=&quot;position&quot; content=&quot;1&quot;&gt;&lt;/span&gt;&lt;span class=&quot;division&quot;&gt;/&lt;/span&gt;&lt;span property=&quot;itemListElement&quot; typeof=&quot;ListItem&quot;&gt;&lt;a property=&quot;item&quot; typeof=&quot;WebPage&quot; class=&quot;post-root post post-post&quot; href=&quot;&lt;?php echo home_url('/blog/');?&gt;&quot; title=&quot;Ga naar Nieuws.&quot;&gt;&lt;span property=&quot;name&quot;&gt;Nieuws&lt;/span&gt;&lt;/a&gt;&lt;meta property=&quot;position&quot; content=&quot;2&quot;&gt;&lt;/span&gt;&lt;span class=&quot;division&quot;&gt;/&lt;/span&gt;
      &lt;span property=&quot;itemListElement&quot; typeof=&quot;ListItem&quot;&gt;
                  &lt;?php
  $categories = get_the_category();
  $separator = ',';
  $output = '';
  if($categories){
    $i=1;
    foreach($categories as $category) {
        if($i==1){
        if($category-&gt;cat_name!=&quot;Homepage&quot;){
      echo '&lt;a property=&quot;item&quot; typeof=&quot;WebPage&quot; href=&quot;'.get_category_link( $category-&gt;term_id ).'&quot; title=&quot;' . esc_attr( sprintf( __( &quot;View all posts in %s&quot; ), $category-&gt;name ) ) . '&quot;&gt;'.$category-&gt;cat_name.'&lt;/a&gt;';
    $i++; } } } } ?&gt;
        &lt;meta property=&quot;position&quot; content=&quot;3&quot;&gt;&lt;/span&gt;
      &lt;span class=&quot;division&quot;&gt;/&lt;/span&gt;&lt;span property=&quot;itemListElement&quot; typeof=&quot;ListItem&quot;&gt;&lt;span property=&quot;name&quot;&gt;&lt;?php the_title();?&gt;&lt;/span&gt;&lt;meta property=&quot;position&quot; content=&quot;4&quot;&gt;&lt;/span&gt;&lt;/div&gt;
  </code></pre>
  <p><strong>Code i need to edit:</strong></p>
  <pre><code>echo '&lt;a property=&quot;item&quot; typeof=&quot;WebPage&quot; href=&quot;'.get_category_link( $category-&gt;term_id ).'&quot; title=&quot;' . esc_attr( sprintf( __( &quot;View all posts in %s&quot; ), $category-&gt;name ) ) . '&quot;&gt;'.$category-&gt;cat_name.'&lt;/a&gt;';
  </code></pre>
  <p>So i like to add this <code>&lt;span property=&quot;name&quot;&gt;</code> before the .$category-&gt;cat_name.</p>
  <p>And the closing <code>&lt;/span&gt;</code> before the closing <code>&lt;/a&gt;</code></p>
  <p>Thanks in advance!</p>