Permalink
Browse files

ループで preg_split を使わないようにした

  • Loading branch information...
okashoi committed Jul 15, 2017
1 parent ef0ffc3 commit 0b9792e9bf7eec3fd9d484f1c0e2d81a63584eb5
Showing with 1 addition and 2 deletions.
  1. +1 −2 php/views/index.html.php
View
@@ -5,8 +5,7 @@
<ul id="memos">
<?php foreach($memos as $memo) { ?>
<li>
<?php $fragments = preg_split("/\r?\n/", $memo["content"]); ?>
<a href="<?php echo uri_for('/memo/') ?><?php echo $memo["id"] ?>"><?php echo $fragments[0] ?></a> by <?php echo $memo["username"] ?> (<?php echo $memo["created_at"] ?>)
<a href="<?php echo uri_for('/memo/') ?><?php echo $memo["id"] ?>"><?php echo trim(explode("\n", $memo["content"])[0]) ?></a> by <?php echo $memo["username"] ?> (<?php echo $memo["created_at"] ?>)
</li>
<?php } ?>
</ul>

0 comments on commit 0b9792e

Please sign in to comment.