Search found 9 matches
- Fri Feb 09, 2007 9:55 pm
- Forum: PHP - Code
- Topic: file_get_contents cookie?
- Replies: 7
- Views: 793
- Fri Feb 09, 2007 9:21 pm
- Forum: PHP - Code
- Topic: str_replace with search and replace arrays
- Replies: 3
- Views: 607
- Fri Feb 09, 2007 8:41 pm
- Forum: PHP - Code
- Topic: str_replace with search and replace arrays
- Replies: 3
- Views: 607
str_replace with search and replace arrays
The current PHP manual gives the following example for str_replace: // Order of replacement $str = "Line 1\nLine 2\rLine 3\r\nLine 4\n"; $order = array("\r\n", "\n", "\r"); $replace = '<br />'; // Processes \r\n's first so they aren't converted twice. $newstr ...
- Wed Feb 07, 2007 3:59 pm
- Forum: PHP - Code
- Topic: Strings: best practice?
- Replies: 12
- Views: 510
- Tue Feb 06, 2007 7:03 pm
- Forum: PHP - Code
- Topic: Strings: best practice?
- Replies: 12
- Views: 510
I really don't want to get down and dirty with the garbage collector! What I want to do is to establish good coding practices for strings, so that if there are several comparable approaches to a programming task I can choose the one that will wreak the least havoc under the covers. Once I've done th...
- Tue Feb 06, 2007 6:38 pm
- Forum: PHP - Code
- Topic: Strings: best practice?
- Replies: 12
- Views: 510
- Tue Feb 06, 2007 6:00 pm
- Forum: PHP - Code
- Topic: Strings: best practice?
- Replies: 12
- Views: 510
- Tue Feb 06, 2007 5:17 pm
- Forum: PHP - Code
- Topic: Strings: best practice?
- Replies: 12
- Views: 510
- Tue Feb 06, 2007 4:50 pm
- Forum: PHP - Code
- Topic: Strings: best practice?
- Replies: 12
- Views: 510
Strings: best practice?
I know that it's possible to update a character of a string in place -- e.g. $message[4] = 'T' -- but is this considered best practice? Are PHP strings mutable? (If not, would the interpreter create a separate copy of the entire $message string when the above code is executed?)
Thanks.
Thanks.