waplet Posted September 12, 2009 Report Share Posted September 12, 2009 $textcontent = minus($row[0]);// šeit vajadzētu izlasīt visiem simboliem $textcontent = saisinat($textcontent,100);// ja garāks par 100.. saīsina un pieliek trīspunkti funkcijas function saisinat($teksts,$lenght) { $garums = strlen($teksts); $teksts = substr($teksts, -$garums, $lenght); if($garums > $lenght){ $teksts = $teksts."..."; } return $teksts; } function minus($teksts){ $minus = array("'", "-", "*",); $teksts = str_replace($minus, "",$teksts); return htmlspecialchars($teksts); } Nesaprotu kāpēc viņš neizlasa tos mīnusus ārā. Vai ir kāds savādāks paņēmietns lai izasīju ārā? Quote Link to comment Share on other sites More sharing options...
kechums Posted September 12, 2009 Report Share Posted September 12, 2009 11. rindiņā, kas tas par komatu masīva beigās? Quote Link to comment Share on other sites More sharing options...
waplet Posted September 12, 2009 Author Report Share Posted September 12, 2009 Bet tas nemaina lietas būtību, kāpēc neizlasa :/ Quote Link to comment Share on other sites More sharing options...
waplet Posted September 12, 2009 Author Report Share Posted September 12, 2009 Piedodat par DP? Bet tiešam neviens nezin? vai kādu savādāku funkciju? Quote Link to comment Share on other sites More sharing options...
Val Posted September 12, 2009 Report Share Posted September 12, 2009 hz, darbojas. function minus($teksts){ $minus = array("'", "-", "*",); $teksts = str_replace($minus, "",$teksts); return htmlspecialchars($teksts); } $x = "šeit' '-' **** vajadzētu"; echo $textcontent = minus($x);// šeit vajadzētu 11. rindiņā, kas tas par komatu masīva beigās? Having a trailing comma after the last defined array entry, while unusual, is a valid syntax. Quote Link to comment Share on other sites More sharing options...
waplet Posted September 12, 2009 Author Report Share Posted September 12, 2009 Labi tas tākā būtu tālāk http://php.lv/f/topic/14436-draugiemsay/ Paldies.. varbūt es vienkārši kko neskatījos tā vai tml... 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.