Archive for November, 2007

To Replace carriage return with “< br >” tag

Thursday, November 22nd, 2007

carriage return==>13(ascii value)
line feed ===>10(ascii value)

This function is used to replace a carriage return with < br > tag.
The ord() function returns the ASCII value of each character.
To check ascii value of each chracter if it is 13(ascii value) it will replace with
<br> tag.If it is 10(ascii value) it will replace with “” tag.

function call

$temp=check_alphabets($str);

function definition

function check_alphabets($str){

for($i=0;$i<strlen($str);$i++)
{
$chara=ord($str[$i]);
if($chara==13)
$str=str_replace($str[$i],”<br>”,$str);
if($chara==10)
$str=str_replace($str[$i],”",$str);
}
return $str;

}

Posted by Kalaivani S

Php with .net (Phalanger)

Tuesday, November 13th, 2007

Microsoft is taking the first steps toward extending its support for other scripting languages with a new project to ry to run PHP on .NET.

Known as Phalanger, the project reached Version 2.0 Beta 2 on July 30.

The primary goal of the project, released under Microsoft Shared Source Permissive License, is to enable full functionality of existing PHP scripts on .Net without any modification, Microsoft said. Unlike the original PHP interpreter, Phalanger compiles scripts into MSIL (Microsoft Intermediate Language).

Posted by Suresh B