title: how to remove whitespaces from each beginning of a php string
body: <p>How to execute align left for text?
  This is one variable text string which server got, so need transform it, ust like execute align left for all line but save other format if it possible</p>
  <p>standart <code>preg_replace(&quot;/^\s+/&quot;, &quot;&quot;, $text)</code> remove all saces but need only from begginig on new line
  actual text</p>
  <pre><code>Resolved
          devic_name: my_device_name - device title if available, if not - fqhost or remote ip address
          device_url : http://test/#/groups/de5a4eb96125d63a6fb330d6afbf44fbe9077a0ba796de1f40e28f70d8489362 - direct url to the device page on the qbee platform
          device_link: [my_device_name](http://test/#/groups/de5a4eb96125d63a6fb330d6afbf44fbe9077a0ba796de1f40e28f70d8489362) - html construct my_device_name
          title: devpi1 - device title which can be set on the device page
          fqhost: devpi1 - the fully qualified name of the host
          remoteaddr: ip: 188.95.241.148 - remove IP addres of the device
          alert_name: parser - name of the alert
          alert_url: http://test/some_path/alert/837f2ad5-7b42-4434-87ea-b4e1793dc212 - direct url to the alert page
          alert_link: [parser](http://test/some_path/alert/837f2ad5-7b42-4434-87ea-b4e1793dc212) - html construct parser
  </code></pre>
  <p>expected</p>
  <pre><code>Resolved
  devic_name: my_device_name - device title if available, if not - fqhost or remote ip address
  device_url : http://test/#/groups/de5a4eb96125d63a6fb330d6afbf44fbe9077a0ba796de1f40e28f70d8489362 - direct url to the device page on the qbee platform
  device_link: [my_device_name](http://test/#/groups/de5a4eb96125d63a6fb330d6afbf44fbe9077a0ba796de1f40e28f70d8489362) - html construct my_device_name
  title: devpi1 - device title which can be set on the device page
  fqhost: devpi1 - the fully qualified name of the host
  remoteaddr: ip: 188.95.241.148 - remove IP addres of the device
  alert_name: parser - name of the alert
  alert_url: http://test/some_path/alert/837f2ad5-7b42-4434-87ea-b4e1793dc212 - direct url to the alert page
  alert_link: [parser](http://test/some_path/alert/837f2ad5-7b42-4434-87ea-b4e1793dc212) - html construct parser
  </code></pre>
  <p>I did it like that</p>
  <pre><code>        $transText = &quot;&quot;;
      foreach(preg_split(&quot;/((\r?\n)|(\r\n?))/&quot;, $text) as $line){
          $transText .= trim($line) . PHP_EOL;
      }
  </code></pre>
  <p>but maybe there are mor useful cases ?</p>