Armenian Knowledge Base  

Go Back   Armenian Knowledge Base > Technical sections > Webmaster Zone > Web Development
Register

Reply
 
LinkBack Thread Tools
Old 06.04.2007, 15:46   #1
полюбому йес эм...
 
Mesrop's Avatar
 
Join Date: 02 2005
Location: near the computer
Age: 26
Posts: 3,243
Downloads: 3
Uploads: 0
Reputation: 129 | 3
Default PHP: htmlspecialchars_decode();

string htmlspecialchars_decode ( string $string [, int $quote_style] )
serverum as default dras e vor $quote_style = ENT_QUOTES;
inchpes karam et defaulte poxem? (cankali e arans php.ini -i, tekuz htaccess)
uzum em defaulte dnel ENT_COMPAT; bays chem uzum amen angam functione kancheluc grem htmlspecialchars_decode ( $string ,ENT_COMPAT );
naxoroq mersiner!
Reply With Quote
Old 06.04.2007, 18:14   #2
Untouchable misanthrope
 
AvDav's Avatar
 
Join Date: 07 2004
Location: Pure thoughts
Age: 36
Posts: 3,408
Downloads: 22
Uploads: 0
Reputation: 222 | 3
Default

e inchna xangarum gres $quote_style = ENT_COMPAT ? ete petq e aveli chkun - if/else-i tak dir scripty vorpes command line argument poxanci paymany.
Reply With Quote
Old 07.04.2007, 16:50   #3
Дошкольник
 
Join Date: 10 2004
Location: Yerevan
Age: 29
Posts: 116
Downloads: 8
Uploads: 0
Reputation: 2 | 0
Default

1). override_function ( string function_name, string function_args, string function_code )
(PECL)
2). Edit PHP source code

reflectionnerov urish dzev baci 1).-ic el dzev chi vrode.
Imast/hnaravorutyun chem tenum, inch vor constant redefine anelu.
Ete daje hnaravor liner, hetaga development-i @ntacqum problemner klinen et function-i usage-i het.

Last edited by Intel; 08.04.2007 at 13:25. Reason: changed i to e :-P
Reply With Quote
Old 07.04.2007, 17:02   #4
Untouchable misanthrope
 
AvDav's Avatar
 
Join Date: 07 2004
Location: Pure thoughts
Age: 36
Posts: 3,408
Downloads: 22
Uploads: 0
Reputation: 222 | 3
Default

amena kyasar varianty henc ( $string ,ENT_COMPAT );-na, 1 hat argument vor avel tas inc kexni or?
Reply With Quote
Old 07.04.2007, 20:34   #5
полюбому йес эм...
 
Mesrop's Avatar
 
Join Date: 02 2005
Location: near the computer
Age: 26
Posts: 3,243
Downloads: 3
Uploads: 0
Reputation: 129 | 3
Default

Quote:
Originally Posted by AvDav View Post
amena kyasar varianty henc ( $string ,ENT_COMPAT );-na, 1 hat argument vor avel tas inc kexni or?
harce nranum e, vor mot 200 failani script e, and ira mejis [email protected] kanchvum e et functione... henc ($strinf) -ov... bays miban aresi... et sax faileri mej functoni anune poxeci urish anuni, u dzerov im uzas functione gresi..


PHP Code:
function htmlspecialchars_decode_m($string) {
    
$stringstr_replace(""""\""$string);
    
$stringstr_replace("'""'"$string);
    
$stringstr_replace("&lt;""<"$string);
    
$stringstr_replace("&gt;"">"$string);
    
$stringstr_replace("&amp;""&"$string);
    return 
$string;
  } 
Reply With Quote
Old 08.04.2007, 13:23   #6
Дошкольник
 
Join Date: 10 2004
Location: Yerevan
Age: 29
Posts: 116
Downloads: 8
Uploads: 0
Reputation: 2 | 0
Default

Sovorabar, nman depqeum, nor function-ic kanchum en hin@ urish argumentnerov.

PHP Code:
function htmlspecialchars_decode_m($string
{
   
htmlspecialchars_decode($stringENT_COMPAT);

kam, ete meka sagh hatik hatik edit es anelu sarqes qo grac-@, hena miangamic sarqi htmlspecialchars_decode($string, ENT_COMPAT);
Zend@ angam hatuk feature uni, dra hamar.

BTW
$string= str_replace("'", "'", $string);
Reply With Quote
Old 08.04.2007, 17:39   #7
полюбому йес эм...
 
Mesrop's Avatar
 
Join Date: 02 2005
Location: near the computer
Age: 26
Posts: 3,243
Downloads: 3
Uploads: 0
Reputation: 129 | 3
Default

Quote:
Originally Posted by Intel View Post
Sovorabar, nman depqeum, nor function-ic kanchum en hin@ urish argumentnerov.

PHP Code:
function htmlspecialchars_decode_m($string
{
   
htmlspecialchars_decode($stringENT_COMPAT);

kam, ete meka sagh hatik hatik edit es anelu sarqes qo grac-@, hena miangamic sarqi htmlspecialchars_decode($string, ENT_COMPAT);
Zend@ angam hatuk feature uni, dra hamar.

BTW
$string= str_replace("'", "'", $string);
replace chey kara anel, vortev $string -i anune tarber failerum tarber e, => chey kara grel REPLACE htmlspecialchars_decode($string); to htmlspecialchars_decode($string, ENT_COMPAT);
isk func-i mejis func canchele kargin ban asesir... mtqovs cher ansel thanks!
Reply With Quote
Sponsored Links
Reply

Thread Tools


На правах рекламы:
реклама

All times are GMT. The time now is 15:19.


Powered by vBulletin® Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.