Your PHP questions answered

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sevent
    Confirmed User
    • Jun 2006
    • 104

    #1

    Your PHP questions answered

    To celebrate my 2nd post (whoooo wooo!) I'll be answering any PHP question you have for the next hour.
  • NiggaRiche
    Confirmed User
    • Aug 2006
    • 107

    #2
    write me a big cms management script.

    i mean

    can you write me a big cms management script?

    Comment

    • CaptainHowdy
      Too lazy to set a custom title
      • Dec 2004
      • 94052

      #3
      Why the hell PHP stands for "Personal Home Page"??

      Comment

      • sevent
        Confirmed User
        • Jun 2006
        • 104

        #4
        Originally posted by CaptainHowdy
        Why the hell PHP stands for "Personal Home Page"??
        I doesn't. It stands for PHP Hypertext Processor.

        Next.

        Comment

        • 2HousePlague
          CURATOR
          • Jul 2004
          • 14572

          #5






          2hp
          tada!

          Comment

          • donross
            Confirmed User
            • Aug 2005
            • 1295

            #6
            what do you need to build PHP SMS script??
            Email: [email protected] | Skype: ross.alcazar

            Comment

            • xxxice
              Confirmed User
              • Feb 2002
              • 5042

              #7
              can php make it so the text that is printed on a page can all be a certain length: like 20 characters or something? what is the code?

              Comment

              • sevent
                Confirmed User
                • Jun 2006
                • 104

                #8
                Sure.

                To find out the length of a string use the strlen() function.

                To pad on extra characters or remove some use substr

                Info about each of these at php.net. You can also treat a string like an array of characters using []. ie. $string[23] = "d";

                Originally posted by vanderweb
                can php make it so the text that is printed on a page can all be a certain length: like 20 characters or something? what is the code?

                Comment

                • sevent
                  Confirmed User
                  • Jun 2006
                  • 104

                  #9
                  Search Google for php esendex

                  Originally posted by donross
                  what do you need to build PHP SMS script??

                  Comment

                  • mfps
                    Confirmed User
                    • Mar 2006
                    • 640

                    #10
                    Originally posted by sevent
                    You can also treat a string like an array of characters using []. ie. $string[23] = "d";
                    i did not know that.

                    nice tip

                    Comment

                    • sevent
                      Confirmed User
                      • Jun 2006
                      • 104

                      #11
                      Originally posted by mfps
                      i did not know that.

                      nice tip
                      Yup. Just another reason why PHP kick way more ass than that overhyped new mother fucking Samual L Jackson film.

                      Comment

                      • mfps
                        Confirmed User
                        • Mar 2006
                        • 640

                        #12
                        Originally posted by sevent
                        Yup. Just another reason why PHP kick way more ass than that overhyped new mother fucking Samual L Jackson film.

                        Comment

                        • r-c-e
                          Confirmed User
                          • Jul 2002
                          • 1070

                          #13
                          How does Ruby on Rails compare wth PHP?

                          Comment

                          • sevent
                            Confirmed User
                            • Jun 2006
                            • 104

                            #14
                            Originally posted by r-c-e
                            How does Ruby on Rails compare wth PHP?
                            Ruby on rails is the programming language Ruby plus the framework "rails". Ruby is one of the more recent programming languages of the moment with no where near the support or base of available scripts as PHP.

                            Comment

                            • sevent
                              Confirmed User
                              • Jun 2006
                              • 104

                              #15
                              Any more questions? Final call. Anyone...? Anyone...?

                              Comment

                              • xxxice
                                Confirmed User
                                • Feb 2002
                                • 5042

                                #16
                                Originally posted by sevent
                                Sure.

                                To find out the length of a string use the strlen() function.

                                To pad on extra characters or remove some use substr

                                Info about each of these at php.net. You can also treat a string like an array of characters using []. ie. $string[23] = "d";
                                thank u

                                what do the 23 and the d stand for in this example? do i put this on any line of the code or does it need it's own line

                                Comment

                                • sevent
                                  Confirmed User
                                  • Jun 2006
                                  • 104

                                  #17
                                  Originally posted by vanderweb
                                  thank u

                                  what do the 23 and the d stand for in this example? do i put this on any line of the code or does it need it's own line
                                  That was just an example. It shows how you *could* put the character "d" at the 24th place in a string*. If you wanted to pad a sting with extra characters you could do a loop which inserted a certain character at each place up to whatever.

                                  * Remember arrays start with zero

                                  Comment

                                  • footmonkey
                                    Confirmed User
                                    • Nov 2005
                                    • 639

                                    #18
                                    Originally posted by uproared
                                    Here, use this...

                                    PHP Code:
                                    function truncate_string($string, $max_length){
                                    
                                        if (strlen($string) > $max_length) {
                                    
                                             $string = substr($string,0,$max_length);
                                    
                                             $string .= '..';
                                    
                                        }
                                    
                                    return $string;
                                    
                                    } 
                                    
                                    Looks good to me. I like seeing other people's code.

                                    Comment

                                    • madawgz
                                      8.8.8.8
                                      • Mar 2006
                                      • 30509

                                      #19
                                      Originally posted by sevent
                                      Yup. Just another reason why PHP kick way more ass than that overhyped new mother fucking Samual L Jackson film.
                                      damn straight
                                      TAEMDLRMSKRJIXMRLSMRJ.

                                      Comment

                                      • xxxice
                                        Confirmed User
                                        • Feb 2002
                                        • 5042

                                        #20
                                        Hmm I still can't get it to work

                                        Comment

                                        • Jamie
                                          Confirmed User
                                          • Apr 2001
                                          • 2517

                                          #21
                                          Originally posted by vanderweb
                                          Hmm I still can't get it to work

                                          That's not a question, next.
                                          CelebPay: Promote Celebrity Reviews
                                          i/c/q - :1851935

                                          Comment

                                          • Naja-ram
                                            Confirmed User
                                            • Aug 2006
                                            • 639

                                            #22
                                            in what ways is php better than java?
                                            in what ways is java better then php?
                                            http://www.muslimmatrimonial.com/

                                            Comment

                                            • teksonline
                                              So Fucking Banned
                                              • Jan 2005
                                              • 2904

                                              #23
                                              For the bloggers, Whats the code for getting a current date/time in a rfc 822 format?

                                              Comment

                                              • LazyD
                                                Confirmed User
                                                • Aug 2004
                                                • 102

                                                #24
                                                Originally posted by teksonline
                                                For the bloggers, Whats the code for getting a current date/time in a rfc 822 format?
                                                date('r');
                                                but that doesn't always work properly (especialy when using feed validator)... so if it doesn't work use the long way : date('D, d M Y H:i:s T');
                                                Calidi studio
                                                http://www.calidi.com
                                                ICQ: #18466283

                                                Comment

                                                • teksonline
                                                  So Fucking Banned
                                                  • Jan 2005
                                                  • 2904

                                                  #25
                                                  ooh fire yourself T is not the answer

                                                  Comment

                                                  Working...