Jump to content


Photo

*SOLVED* limit ourput to 24 charactors


  • Please log in to reply
3 replies to this topic

#1 shocker-z

shocker-z
  • Members
  • PipPipPip
  • Advanced Member
  • 864 posts
  • LocationNottingham

Posted 20 April 2006 - 11:33 AM

Hi there,
How can i output only the first 24 charactors of a line?

its for trimming an address to only output 24 charactors to paste straight into a dos based program..


Regards
Liam
www: www.ukchat.ws | irc: irc.ukchat.ws chan: #blufudge

#2 slashemail

slashemail
  • Members
  • PipPip
  • Member
  • 15 posts

Posted 20 April 2006 - 11:45 AM

Use something like

echo substr($string_to_trim, 0, 24); // Displays the first 24 characters.

Hope this helps.....


#3 Roberto

Roberto
  • Members
  • PipPip
  • Member
  • 16 posts
  • LocationLondon, England

Posted 20 April 2006 - 11:46 AM

[!--quoteo(post=366776:date=Apr 20 2006, 12:33 PM:name=shocker-z)--][div class=\'quotetop\']QUOTE(shocker-z @ Apr 20 2006, 12:33 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
How can i output only the first 24 charactors of a line?
[/quote]
echo substr ($your_string, 0 , 24)

Rob
*************************************
Mad Mouse Media Web Design
t: (+34) 610 837 558
e: rob@madmousemedia.co.uk
w: www.madmousemedia.co.uk
w: www.madmouseart.com *************************************

#4 shocker-z

shocker-z
  • Members
  • PipPipPip
  • Advanced Member
  • 864 posts
  • LocationNottingham

Posted 20 April 2006 - 12:35 PM

cheers lads :) *SOLVED*
www: www.ukchat.ws | irc: irc.ukchat.ws chan: #blufudge




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users