4

I have two functions nl2br and substr which I would like to combine together, could someone please tell how I would achieve this:

<?php echo nl2br($row_rsMyrecordSet['text']); ?>

<?php echo substr($row_rsMyrecordSet['text'],0,10); ?>

I'm thinking something along the lines of:

<?php echo nl2br & substr($row_rsMyrecordSet['text'],0,10); ?>
Gyrocode.com
  • 57,606
  • 14
  • 150
  • 185
Frank Smith
  • 119
  • 1
  • 8

2 Answers2

2

Seeing my first post was indeed the answer to this problem, am posting it as an answer.

You can actually use both functions, just as long as they're wrapped in brackets.

Like so...

<?php echo nl2br(substr($row_rsMyrecordSet['text'],0,10)); ?> 
Funk Forty Niner
  • 74,450
  • 15
  • 68
  • 141
-1

You can use any predefined function with other predefined

<?php echo nl2br(substr($row_rsMyrecordSet['text'],0,10)); ?>
Uday
  • 9
  • 2
  • This is the second answer I noticed you placed underneath mine. The other being http://stackoverflow.com/a/31018578/, coincidence? I kind of doubt it. That isn't my downvote, but you probably got it because of it. – Funk Forty Niner Jun 24 '15 at 13:29