To celebrate my 2nd post (whoooo wooo!) I'll be answering any PHP question you have for the next hour.
Your PHP questions answered
Collapse
X
-
-
-
-
Comment
-
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 vanderwebcan 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
-
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.Originally posted by r-c-eHow does Ruby on Rails compare wth PHP?Comment
-
thank uOriginally posted by seventSure.
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";
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
-
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.Originally posted by vanderwebthank 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
* Remember arrays start with zero
Comment
-
Looks good to me. I like seeing other people's code.Originally posted by uproaredHere, use this...
PHP Code:function truncate_string($string, $max_length){ if (strlen($string) > $max_length) { $string = substr($string,0,$max_length); $string .= '..'; } return $string; }
Comment
-
in what ways is php better than java?
in what ways is java better then php?Comment
-
-
date('r');Originally posted by teksonlineFor the bloggers, Whats the code for getting a current date/time in a rfc 822 format?
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');Comment
-



Comment