Mike088 Posted October 14, 2008 Share Posted October 14, 2008 Hey everyone I'm trying to encode a variable into UTF8 char set, I don't want the whole thing UTF8 just this variables data. How would I go about doing that? My variable as follows: $link = ("<a href=\"http://$url\blahblah">Link Here</a>"); I tried and failed with this: string utf8_encode (string $link); So all up I want to encode the variable then print/echo it. Help appreciated Link to comment https://forums.phpfreaks.com/topic/128318-solved-utf8-encoding/ Share on other sites More sharing options...
Daniel0 Posted October 14, 2008 Share Posted October 14, 2008 You should just do utf8_encode($link); The "string" part is just for specifying datatypes. It means that the $link argument should be a string and that the function will return a string value. Link to comment https://forums.phpfreaks.com/topic/128318-solved-utf8-encoding/#findComment-664779 Share on other sites More sharing options...
Mike088 Posted October 14, 2008 Author Share Posted October 14, 2008 You should just do utf8_encode($link); The "string" part is just for specifying datatypes. It means that the $link argument should be a string and that the function will return a string value. Thanks for that mate Link to comment https://forums.phpfreaks.com/topic/128318-solved-utf8-encoding/#findComment-664791 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.