Jump to content
php.lv forumi

ievietoshana tekstaa


andrez

Recommended Posts

kaa vareetu ja mums ir mainiigais kuraa ir liels strings. nu piemeeram kaads raksts.

un mese gribam ielitk citu stringu aptuveni peec 1/3 teksta peec komanta.

 

piemeeram

$string='

lalalalalla. asdasd. asdasdasd.a sdasd

asdasd.asdasd.asdads.asdasd

asdadas.asdasdasd .asd asd a.sdasd.';

 

$string=do($string, "kaka");

 

un rezulultaatam vajadzeetu buut

 

$string='

lalalalalla. asdasd. asdasdasd.kakaa sdasd

asdasd.asdasd.asdads.asdasd

asdadas.asdasdasd .asd asd a.sdasd.';

Link to comment
Share on other sites

kaa vareetu ja mums ir mainiigais kuraa ir  liels strings. nu piemeeram kaads  raksts.

un mese gribam ielitk citu stringu  aptuveni peec 1/3 teksta peec komanta.

 

piemeeram

$string='

lalalalalla.  asdasd. asdasdasd.a sdasd

asdasd.asdasd.asdads.asdasd

asdadas.asdasdasd .asd  asd a.sdasd.';

 

$string=do($string,  "kaka");

 

un rezulultaatam vajadzeetu buut

 

$string='

lalalalalla.  asdasd. asdasdasd.kakaa sdasd

asdasd.asdasd.asdads.asdasd

asdadas.asdasdasd .asd  asd a.sdasd.';

13648[/snapback]

 

Ja pareizi sapratu tad kaut kaa shaadi

 

 

$texts = substr($texts, 0, ceil(strlen($texts)/3))).'kaka'.substr($texts, ceil(strlen($texts)/3))+1);

Link to comment
Share on other sites

×
×
  • Create New...