FAQ |
Kalender |
![]() |
#1 | ||
|
|||
Flitig postare
|
Tjenna. Denna kod funkar:
echo preg_replace ('/\<code\>(.*?)\<\/code\>/isx', '<pre class="code">$1</pre>', $content); Men jag vill kunna sätta htmlentities($1) på koden som är inuti <code>. preg_replace funkar men hur sätter jag funktionen på den? |
||
![]() |
![]() |
![]() |
#2 | |||
|
||||
Flitig postare
|
Kod:
echo preg_replace ('/\<code\>(.*?)\<\/code\>/isxe', "'<pre class=\"code\">'.htmlentities('$1').'</pre>'", $content); |
|||
![]() |
![]() |
![]() |
#3 | ||
|
|||
Flitig postare
|
Hmm, vad gör EVAL? Låter den dig ha php kod i replace-taggen?
Senast redigerad av frecka den 2011-11-24 klockan 12:35 |
||
![]() |
![]() |
![]() |
#4 | ||
|
|||
Mycket flitig postare
|
Exakt
![]() |
||
![]() |
![]() |
Svara |
|
|