Page 2 of 2 First 12
  • Jump to page:
    #16
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    11
    Rep Power
    0
    Originally Posted by Axweildr
    php Code:
      $str='@ sentence @';
      echo $str."<br />";
      $newstr = substr_replace($str, '', strlen($str)-1, 1);
      $newstr = substr_replace($newstr, '', 0, 1);
      echo $newstr."<br />\n";

    Use with extreme caution, and back up your data first ...
    it's works ,but for just one syllabus string.
    if my string will change to : "@sadasd@ asd ad asd "
    it's can't detect it.
  2. #17
  3. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Location
    Pennsylvania, USA
    Posts
    10,846
    Rep Power
    6351
    Am I invisible in this thread?

    Comments on this post

    • ptr2void agrees : Yes, unfortunately. Probably because you didn't offer up code.
    HEY! YOU! Read the New User Guide and Forum Rules

    "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

    "The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

    Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.
  4. #18
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    11
    Rep Power
    0
    Originally Posted by ManiacDan
    Am I invisible in this thread?
    why? we are seeing your posts.
  6. #19
  7. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Location
    Pennsylvania, USA
    Posts
    10,846
    Rep Power
    6351
    You don't seem to be. I said Axweildr's solution wouldn't work for you 3 hours before you tried it and said it didn't work.

    There is one solution to custom markup parsing: Write it yourself. There is no regex solution, there is no str_replace solution, it's just stepping through the string one character at a time looking for your tags.
    HEY! YOU! Read the New User Guide and Forum Rules

    "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

    "The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

    Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.
  8. #20
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    11
    Rep Power
    0
    Originally Posted by ManiacDan
    You don't seem to be. I said Axweildr's solution wouldn't work for you 3 hours before you tried it and said it didn't work.

    There is one solution to custom markup parsing: Write it yourself. There is no regex solution, there is no str_replace solution, it's just stepping through the string one character at a time looking for your tags.
    i'm so sorry about it!
    i didn't see it at that time.
    yes your right.Now i'm trying to do my own function
    thanks to all of my friends that reply me
    Regards
  10. #21
  11. 'fie' on me, allege-dly
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2003
    Location
    in da kitchen ...
    Posts
    12,889
    Rep Power
    6444
    Originally Posted by absfrm
    i'm so sorry about it!
    i didn't see it at that time.
    yes your right.Now i'm trying to do my own function
    thanks to all of my friends that reply me
    Regards
    php may not be the solution you're after.

    Whatever carrot is put in front of you has to be worth the effort required or you'll never reach it ./ end carrot on string metaphor.

    There are many excellent parsing modules available in Perl,but unless you can stand over the origin of each string you plan to process, to be honest, it's looking like a world of hurt
    --Ax
    without exception, there is no rule ...
    Handmade Irish Jewellery
    Targeted Advertising Cookie Optout (TACO) extension for Firefox
    The great thing about Object Oriented code is that it can make small, simple problems look like large, complex ones


    09 F9 11 02
    9D 74 E3 5B
    D8 41 56 C5
    63 56 88 C0
    Some people, when confronted with a problem, think "I know, I'll use regular expressions." Now they have two problems.
    -- Jamie Zawinski
    Detavil - the devil is in the detail, allegedly, and I use the term advisedly, allegedly ... oh, no, wait I did ...
    BIT COINS ANYONE
Page 2 of 2 First 12
  • Jump to page:

IMN logo majestic logo threadwatch logo seochat tools logo