Pogledajte određenu poruku
Staro 22. 04. 2008.   #5
Bojsi
član
Certified
 
Datum učlanjenja: 24.01.2007
Poruke: 92
Hvala: 1
802 "Hvala" u 15 poruka
Bojsi is on a distinguished roadBojsi is on a distinguished roadBojsi is on a distinguished roadBojsi is on a distinguished roadBojsi is on a distinguished roadBojsi is on a distinguished roadBojsi is on a distinguished road
Default

Malo sam doradio i uprostio i sve sto mi treba je da svaki nadjeni /n zameni sa & nbsp

PHP kôd:
<?php

$input 
'
ovo
je
tekst

abc

<pre>
var
    x: Integer;
begin
    x := 10;
end;
</pre>
'
;

function 
zamene($matches)
{
    return 
strtr($matches, array("\n" => "&nbsp;"));
}

$out preg_replace_callback('|\<pre\>(.+?)\<\/pre\>|''zamene'$input);

echo 
$out;
?>
Sad da li sam napravio neku ociglednu gdesku, uh ne znam vise
Bojsi je offline   Odgovorite uz citat