php - Is there a way that I can use sprintf() to limit a line/field size? -


I wrote a bit of the following code and if there is a way so that it does not do that I have to Could have limited line of line overflow and wrap in a new line.

  "Category product selected" echo "\ N"; Echo "------------------------------------------------ ------------------------- \ n "". "; Forex currency ($ category_page $ key = & gt; $ value) {echo sprintf ("% 8s% s", $ key, $ value) "\ N"; }  
Keep in mind that this is a plain text formatting for e-mail / file in

bears.

Thanks Dagon.

  "Category product selected" echo "\ N"; Echo "------------------------------------------------ -------------------------------- \ n "". "; Forex currency ($ category_list $ key = & gt; $ value) {$ wrap_value = wordwrap ($ value, 60, "\ n", TRUE); Echo Sprint ("% 8s% s", $ K, $ Work_Value) "\ N"; }  

I did not know how to add it as an empty space, so I just added it to the new line.

Sample Output:

Category Product Selected ------------------------------ -------------------------------------------------- 1 4386,4387 4 14,623,16,17 5 309.335.323.331.313 6 1004,1003,997,996,1002,1004,1003,997,996,1002,1004,1003,997,996,1002,1004,1003 , 997,996,1002, 1004,1003,997,996,1002,1004,1003,997,996,1002,1004,1003,997,996,1002,1004,1003,997,996,1 002,1004,1003,997,996,1002,1004,1003, 997,996,1002, 1004,1003, 997,996,1002,1004,1003,997,996,1002, 7154,52,124,85,88 8 266.253.224.180.209 9 278.284.276.291.275 10 297

Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -