Comments on: PHP String Concatentation Performance http://www.frankmaulit.com/2009/04/17/php-string-concatentation-performance/ better than your blog. Sat, 29 Oct 2011 20:51:57 +0000 hourly 1 http://wordpress.org/?v=3.2.1 By: z http://www.frankmaulit.com/2009/04/17/php-string-concatentation-performance/comment-page-1/#comment-3753 z Sat, 18 Apr 2009 08:12:38 +0000 http://www.frankmaulit.com/2009/04/17/php-string-concatentation-performance/#comment-3753 why not try an implode()? [this is assuming that you're trying concat with an array of course, and my assumption is based on your "foreach" statement] it's a native function, and may work to your benefit example: $orange = array("orange", "you", "glad", "i", "didn't", "say", "banana"); $orange_str = implode(" ", $orange); echo $orange_str; // "orange you glad i didn't say banana" doesn't hurt to try. also, if you don't like the word implode, you could simply use join() [i like this better because it's like python =)] why not try an implode()?
[this is assuming that you're trying concat with an array of course, and my assumption is based on your "foreach" statement]
it’s a native function, and may work to your benefit

example:
$orange = array(“orange”, “you”, “glad”, “i”, “didn’t”, “say”, “banana”);
$orange_str = implode(” “, $orange);
echo $orange_str; // “orange you glad i didn’t say banana”

doesn’t hurt to try. also, if you don’t like the word implode, you could simply use join() [i like this better because it's like python =)]

]]>
By: Johnny156 http://www.frankmaulit.com/2009/04/17/php-string-concatentation-performance/comment-page-1/#comment-3729 Johnny156 Fri, 17 Apr 2009 23:39:23 +0000 http://www.frankmaulit.com/2009/04/17/php-string-concatentation-performance/#comment-3729 What is more likely the case, is in that first way you are actually creating a new string when you concat on $orange_str. While $orange_str .= actually appends to the existing string. This depends on the language. (i.e. Java strings are immutable so when you do += on a java string it actually has to make a brand new string) What is more likely the case, is in that first way you are actually creating a new string when you concat on $orange_str. While $orange_str .= actually appends to the existing string. This depends on the language. (i.e. Java strings are immutable so when you do += on a java string it actually has to make a brand new string)

]]>
1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|51|52|53|54|55|56|57|58|59|60|61|62|63|64|65|66|67|68|69|70|71|72|73|74|75|76|77|78|79|80|81|82|83|84|85|86|87|88|89|90|91|92|93|94|95|96|97|98|99|100|101|102|103|104|105|106|107|108|109|110|111|112|113|114|115|116|117|118|119|120|121|122|123|124|125|126|127|128|129|130|131|132|133|134|135|136|137|138|139|140|141|142|143|144|145|146|147|148|149|150|151|152|153|154|155|156|157|158|159|160|161|162|163|164|165|166|167|168|169|170|171|172|173|174|175|176|177|178|179|180|181|182|183|184|185|186|187|188|189|190|191|192|193|194|195|196|197|198|199|200|201|202|203|204|205|206|207|208|209|210| buy pills risperdal buy atarax tablets buy risperdal without a prescription cheapest order inderal zofran buy no prescription order no prescription lasix actonel no prescription needed purchase albuterol over counter order valtrex online birth control no prescriptionAccutane Online Doxycycline online Buy Cheap Lexapro Online No Prescription Prednisone Online Buy Accutane No Prescription