php - convert array to string (split 3 words ) -


We have dynamic posts and we should split 3 words of string for use in the url

  $ this-> Post_message = "This sample is for testing STRING"; If (stroll ($ this- & gt; post_says)> 5) {$ key = '& lt; & Gt; "; $ ~! # $% ^ & Amp;; * _ + = - '; $ bodypost1 = trim ($ this- & gt; post_session, $ key); $ bodypost2 = explosion (' ', $ Bodypost1,3); $ Bodypost = array_shift (',', $ bodypost2);} and {$ bodypost2 = explosion ('', $ this - & amp; post_message, 3); $ bodypost = array_shift (',', $ Bodypost2);}  

and this is the URL parameter

  $ this-> permalink = $ C-> SITE_URL.'view / '. ($ Type == 'private'? 'Private': 'post'). ':'. $ This- & gt; post_id. '/'. $ Bodypost. 'Html';  

Back to my URL:

sitename.com/123/THIS.html
should be sitename.com/123/THIS SAMPLHOL

try it

  $ message = "This is sample for testing" "$ string = implode ('', Array_slice ('', $ message), 0, 3)); Var_dump ($ string); // result ... string (14) "this is sample"  

Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -