Results 1 to 7 of 7

Thread: PHP - Need help URGENTLY

  1. #1

    Thread Starter
    Fanatic Member VisionIT's Avatar
    Join Date
    Nov 2002
    Location
    Workin'...
    Posts
    718

    PHP - Need help URGENTLY

    Hi all. I know i'm posting this in Chit-Chat... but nobody ever seems to go into PHP section.

    Dead simple this, but my brains fried!

    I have a variable called " $file " without quotes obviously...

    It contains this...

    "file1.txt","file2.txt","file3.txt",

    Which is fine... but notice the trailing "," and the end!!! It causes by Java to screw up and fall over.

    HOW CAN I REMOVE THE END "," FROM THE LINE??? IN PHP???

    Regards,

    Paul.

  2. #2
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Just put a little more smarts into your string tokenizer on the java side of things ?
    But I'll have a looksee...
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  3. #3
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  4. #4

  5. #5

    Thread Starter
    Fanatic Member VisionIT's Avatar
    Join Date
    Nov 2002
    Location
    Workin'...
    Posts
    718
    Well...

    I don't believe out of all those commands... i can't find one that works.

    How difficult can it be to take off a "," from the end of a line!!! ???!!!???

    Here is what $file contains:

    "file.txt","file2.txt","file3.txt","file4.txt",

    I need:

    "file.txt","file2.txt","file3.txt","file4.txt"

    Anyone got any quick code idea's? Cause i'm all out of them...

    Regards,

    Paul.

  6. #6
    Frenzied Member DeadEyes's Avatar
    Join Date
    Jul 2002
    Posts
    1,196
    Code:
    $rest = substr("abcdef", 0, -1);  // returns "abcde"

  7. #7

    Thread Starter
    Fanatic Member VisionIT's Avatar
    Join Date
    Nov 2002
    Location
    Workin'...
    Posts
    718
    Originally posted by DeadEyes
    Code:
    $rest = substr("abcdef", 0, -1);  // returns "abcde"
    Nice one DeadEyes...

    It works perfectly...

    Take a look...

    www.e-visionit.co.uk/preload.php

    It's still being modified... but the PHP works perfectly!

    Regards,

    Paul.

    P.S We know the shop is down...

Posting Permissions

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



Click Here to Expand Forum to Full Width