xmas12 Posted August 24, 2012 Report Share Posted August 24, 2012 Sveiki. Jautājums: Ar kādu funkciju izvadot tekstu no datubāzes - varētu izdzēst tukšās rindas, kuras tiek ievadītas nospiežot vairakas reizes "enter pogu"? Quote Link to comment Share on other sites More sharing options...
briedis Posted August 24, 2012 Report Share Posted August 24, 2012 (edited) $teksts_bez_rindam = str_replace(array("\n", "\r"), null, $teksts); Edited August 24, 2012 by briedis Quote Link to comment Share on other sites More sharing options...
xmas12 Posted August 24, 2012 Author Report Share Posted August 24, 2012 $teksts_bez_rindam = str_replace(array("\n", "\r"), null, $teksts); tāpat izvada tas tukšās rindas. Quote Link to comment Share on other sites More sharing options...
zintis8789 Posted August 24, 2012 Report Share Posted August 24, 2012 Paradi sql lauka info Quote Link to comment Share on other sites More sharing options...
xmas12 Posted August 24, 2012 Author Report Share Posted August 24, 2012 Paradi sql lauka info Izvada no IPB foruma tabulām.. Lauka nosaukums: "post" ar apzīmējumu: "mediumtext". Un pats teksts šis standarta: W[b]elcome to your new Invision P[/b]ower Board!<br /> <br /> <br /> <br /> Congratulations on your purchase of our software and setting up your community. Please take some time and read through the Getting Started Guide and Administrator Documentation. The Getting Started Guide will walk you through some of the necessary steps to setting up an IP.Board and starting your community. The Administrator Documentation takes you through the details of the capabilities of IP.Board.<br /> <br /> <br /> <br /> You can remove this message, topic, forum or even category at any time. Quote Link to comment Share on other sites More sharing options...
xmas12 Posted August 24, 2012 Author Report Share Posted August 24, 2012 Izdevās pašam. Izmantoju: $jauns_teksts = preg_replace('/<br \/>/iU', '', $vecais_teksts); Un izdzēsu visus <br /> tagus arā. Quote Link to comment Share on other sites More sharing options...
daGrevis Posted August 25, 2012 Report Share Posted August 25, 2012 \s{2,} Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.