Possible Duplicate:
how to replace special characters with the ones they’re based on in PHP?
Here is sample code:
$code="CSC113α";//other codes PHY123β,MAT324δ
////return last character of the code
$lastchar=substr($code, -1);
// returns rest code without last character..
$rest = substr($code, 0, -1);
//Make standard course_ID with a,ß..
switch ($lastchar)
{
case 'α':{
$lastchar='A';
$id=$rest.$lastchar ;
$full_course_id=$id;
break;
}
case 'β':{
$lastchar='B';
$id=$rest.$lastchar ;
$full_course_id=$id;
break;
}
case 'δ':{
$lastchar='D';
$id=$rest.$lastchar ;
$full_course_id=$id;
break;
}
default:
$full_course_id=$code;
}
Here I try to replace α,β,δ with A,B,D...This code is not working..Here variable code values comes from another script with special characters..Here I want to replace those characters with normal characters.. I want get final out put like 'CSC113A'..but this switch code doesn't work for me...please help me to do this...thxx in advanced....