SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: ending strings

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Jul 2000
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hi
    i would like to know how do i do to force the end of a string, just like in C with the '\0' caracter. how do i know that a string has reached the end in php?

    thanks

  2. #2
    SitePoint Author Kevin Yank's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne, Australia
    Posts
    2,571
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote/font><HR>i would like to know how do i do to force the end of a string, just like in C with the '\0' caracter.<HR></BLOCKQUOTE>

    Unfortunately this kind of thing cannot be done under PHP, which treats a string as a basic data type as opposed to an array of characters.

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote/font><HR>how do i know that a string has reached the end in php?<HR></BLOCKQUOTE>

    Umm... when there are no more characters?

    If you gave us more details about what you're trying to do, we could probably find a better way of doing it for you...

    ------------------
    -Kevin Yank.
    http://www.SitePoint.com/
    Helping Small Business Grow Online!


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
  •