pcw Posted February 20, 2009 Share Posted February 20, 2009 Hi, I am trying to convert an old perl script into php. And am stuck on the following code. elseif (preg_match_all("m/^ONLINE:(.*)$/", $part)) { if(!defined($online)){ get_online(); } $out .= implode($v1); map ("<a href=sb.php?action=display&login=$_&session=$input['session']>$_</a>") # This is line 426 keys %online; # This is line 428 } When I do a syntax check, I get the following errors: Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in sb.php on line 426 and Parse error: parse error, unexpected T_STRING in sb.php on line 428 I cant seem to work out a translation into PHP, any help is much appreciated Link to comment https://forums.phpfreaks.com/topic/146097-keys-online-php-translation-help/ Share on other sites More sharing options...
Mchl Posted February 20, 2009 Share Posted February 20, 2009 Place $input['session'] into {} map ("<a href=sb.php?action=display&login=$_&session={$input['session']}>$_</a>"); as for the second one, I've no idea. What's this line supposed to do? Link to comment https://forums.phpfreaks.com/topic/146097-keys-online-php-translation-help/#findComment-766970 Share on other sites More sharing options...
pcw Posted February 20, 2009 Author Share Posted February 20, 2009 Thanks for your reply, that done the trick. As for keys %online, i think it translated to array_keys($online); The syntax for that seems to be correct Link to comment https://forums.phpfreaks.com/topic/146097-keys-online-php-translation-help/#findComment-766980 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.