Welcome to the JaguarPC Community
JaguarPC
Sales: (888) 338-5261
Support: (888)-551-3050
Page 1 of 2 12 LastLast
Results 1 to 15 of 25

This is a discussion on chopping down a string in the Shared & Semi-Dedicated forum
I have a blob of text on a string, with new line characters and all. What I need to do is to pick the first ...

  1. #1
    Jag Veteran
    Join Date
    Sep 2001
    Location
    Misawa Japan
    Posts
    538

    chopping down a string

    I have a blob of text on a string, with new line characters and all. What I need to do is to pick the first (Say) 200 characters for a summary of the blob. Long story short it has been a looooong day and I can't figure anything out anymore.

    Oh, and I'm using PHP 4 so chunk_split($row[6], 200); is not an option :\

    Anybody care to throw this dog a bone?

    - DN

  2. #2
    Ron
    Ron is offline
    Loyal Client
    Join Date
    Aug 2002
    Posts
    7,306
    http://us4.php.net/manual/en/function.substr.php

    $two_hundred_character_piece = substr($CompletePiece,0,200);

  3. #3
    Jag Veteran
    Join Date
    Sep 2001
    Location
    Misawa Japan
    Posts
    538
    Thanks. I kept going up and down the manual and I didn't see that one

    - DN

  4. #4
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,775
    I don't exactly what you're trying to do, but if it's what I'm thinking...

    When I want to get rid of trailers, I use a little known PHP function called 'rtrim'. It's the function equivelent of 'chomp' in Perl. You might give that a try.

    EDIT: Okay, nevermind. I see what you're up to. Anyway, stick 'rtrim' in the back of your mind, for future reference. It's quite handy!
    Last edited by Vin DSL; 07-23-2004 at 01:48 PM.
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL © 2010

  5. #5
    Ron
    Ron is offline
    Loyal Client
    Join Date
    Aug 2002
    Posts
    7,306
    Been almost a year since you posted, Dude! Where ya been hiding? Missed you!

  6. #6
    Ron
    Ron is offline
    Loyal Client
    Join Date
    Aug 2002
    Posts
    7,306
    Never mind...
    Last edited by Ron; 07-23-2004 at 01:53 PM.

  7. #7
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,775
    Originally posted by Ron
    He said: How does that fit your guess?
    Yep, just saw that and edited my post. I guess we 'doubled'...
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL © 2010

  8. #8
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,775
    Originally posted by Ron
    Been almost a year since you posted, Dude! Where ya been hiding? Missed you!
    I've got too many irons in the fire right now!

    I've been putting together a HDTV entertainment system. That required a LOT of study, but I did that at the keyboard. Now, I'm into the physical stuff, e.g. going out and buying it. And, returning it. Then, buying something else and returning it.

    What put me over the top was, I begrudgingly agreed to repair the computer of a co-worker. It had a worm, 300 spyware files, and a bad power supply. The OS had to be totally reinstalled (he lost the installation code) and updated, along with all the drivers, et cetera. You get the idea - 3 days of pure hell!

    Then, my computer took a dump too (pure coincidence - trust me), and I had to do the same things to mine, minus the PS. I just got that completed last night.

    Add to that, work, sleep, admin'ing my site and others - working on my 'VinGoogle DSL' proggie, blah, blah, blah...

    I wish there were 72 hours in a day. Then, I'd be fine...
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL © 2010

  9. #9
    Ron
    Ron is offline
    Loyal Client
    Join Date
    Aug 2002
    Posts
    7,306
    I think you need some more sleep!

    I was referring to DevNull. You've posted more recently than a year ago, though not as much as usual.

  10. #10
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,775
    Originally posted by Ron
    I think you need some more sleep!

    I was referring to DevNull. You've posted more recently than a year ago, though not as much as usual.
    I see! I thought you were being enigmatic, like usual; the king of obscure thought...
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL © 2010

  11. #11
    Ron
    Ron is offline
    Loyal Client
    Join Date
    Aug 2002
    Posts
    7,306
    Originally posted by Vin DSL
    I see! I thought you were being enigmatic, like usual; the king of obscure thought...
    Obscure?

  12. #12
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,775
    Originally posted by Ron
    Missed you!
    Ah, I overlooked that the first time. Should have been the dead giveaway...
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL © 2010

  13. #13
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,775
    Originally posted by Ron
    Obscure?
    Yes! You seem to have a rather disjointed mental process, and it's reflected in your writings. Most of the time, I pass it off as an attempt at humor. Other times, I just pass it by...

    I thought you were trying to be funny...
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL © 2010

  14. #14
    Ron
    Ron is offline
    Loyal Client
    Join Date
    Aug 2002
    Posts
    7,306
    Originally posted by Vin DSL
    disjointed mental processes
    My doctor could use an example or two...

  15. #15
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,775
    Sorry...
    Originally posted by Vin DSL
    I've got too many irons in the fire right now!
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL © 2010

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •