Hello
Here's the thing
I have a database edited by some company workers editing descriptions of
books in the sotre , unfortunately these workers do not have the habit of
inserting a space character after word-ending dot, this is why i use the
function:
function getCorrect($txt ) {
$txt=str_replac e(",",", ",$txt);
$txt=str_replac e(".",". ",$txt);
$txt=str_replac e(". ,",".,",$txt );
$txt=str_replac e(". . . ","... ",$txt);
$txt=str_replac e(":",": ",$txt);
$txt=str_replac e(";","; ",$txt);
$txt=str_replac e("]","] ",$txt);
$txt=str_replac e("... ]","...] ",$txt);
$txt=str_replac e(")",") ",$txt);
$txt=str_replac e("... )","...) ",$txt);
$txt=str_replac e(" "," ",$txt);
$txt=str_replac e("„ ","„",$txt) ;
$txt=str_replac e(". )",".) ",$txt);
return $txt;
}
this basically closes the problem, but what bothers me recently is that i
need to indert a href link into this description and i get a result like
www. blah. com/index. php
is there anone who could help me out writing a regexp converting a ". " into
"." if it is inside href="xxx"
i'm not very familiar with regexp's so i would really appreciate your help
TIA
Patrol
Here's the thing
I have a database edited by some company workers editing descriptions of
books in the sotre , unfortunately these workers do not have the habit of
inserting a space character after word-ending dot, this is why i use the
function:
function getCorrect($txt ) {
$txt=str_replac e(",",", ",$txt);
$txt=str_replac e(".",". ",$txt);
$txt=str_replac e(". ,",".,",$txt );
$txt=str_replac e(". . . ","... ",$txt);
$txt=str_replac e(":",": ",$txt);
$txt=str_replac e(";","; ",$txt);
$txt=str_replac e("]","] ",$txt);
$txt=str_replac e("... ]","...] ",$txt);
$txt=str_replac e(")",") ",$txt);
$txt=str_replac e("... )","...) ",$txt);
$txt=str_replac e(" "," ",$txt);
$txt=str_replac e("„ ","„",$txt) ;
$txt=str_replac e(". )",".) ",$txt);
return $txt;
}
this basically closes the problem, but what bothers me recently is that i
need to indert a href link into this description and i get a result like
www. blah. com/index. php
is there anone who could help me out writing a regexp converting a ". " into
"." if it is inside href="xxx"
i'm not very familiar with regexp's so i would really appreciate your help
TIA
Patrol
Comment