title: Show more button in html
body: <p>How can I make a show more button in HTML? I'm importing some text trough a variable in how do I make it so that like 20 characters are being showed and the rest will be showed once the button is pressed. This is what I have now:</p>
  <pre class="lang-php prettyprint-override"><code>$array = explode(&quot;&lt;br&gt;&quot;, $array_build-&gt;content);
  foreach( $array as $key =&gt; $value){
      if (
          strpos(strtolower($value),'value1') !== FALSE ||
          strpos(strtolower($value),'value2') !== FALSE ||
          strpos(strtolower($value),'value3') !== FALSE ||
          strpos(strtolower($value),'value4') !== FALSE
      ) {
          unset($array[$key]);
      }
  };
  
  $newcontent = &quot;&lt;pre&gt;&quot;.implode(&quot;\n&quot;,$array).&quot;&lt;/pre&gt;&quot;;
  ?&gt;
  </code></pre>
  <pre class="lang-html prettyprint-override"><code>&lt;div style=&quot;margin-top: 50px;&quot;&gt;&lt;/div&gt;
  &lt;style&gt;
  .button {
      border-radius: 4px;
      background-color: #002B56;
      color: white;
      padding: 14px 40px;
      }
  &lt;/style&gt;
  &lt;div style=&quot;text-align: center;&quot;&gt;
  
  &lt;script type=&quot;text/javascript&quot;&gt;
  function toggle(obj) {
            var obj=document.getElementById(obj);
            if (obj.style.display == &quot;block&quot;) obj.style.display = &quot;none&quot;;
            else obj.style.display = &quot;block&quot;;
  }
  &lt;/script&gt;
  &lt;a class=&quot;button&quot; href=&quot;javascript: void(0);&quot; onClick=&quot;toggle('q1')&quot;&gt;
  Show More
  &lt;/a&gt;
  &lt;div style=&quot;margin-top: 50px;&quot;&gt;&lt;/div&gt;
  &lt;div id=&quot;q1&quot; style=&quot;display:none;&quot;&gt;
  &lt;div class=&quot;col&quot; style=&quot;width: 100%;&quot;&gt;&lt;?= $newcontent ?&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  <p>Output I want:</p>
  <p>Lorem ipsum dolor sit amet.</p>
  <p>SHOW MORE</p>
  <p>consectetur adipiscing elit. Integer tellus erat, tempor quis dolor a, gravida eleifend leo. Orci varius.</p>