MCPcopy Create free account
hub / github.com/Warzone2100/warzone2100 / simplify

Function simplify

tools/guidecode/r.inc.php:200–212  ·  view source on GitHub ↗
($name,$array=array())

Source from the content-addressed store, hash-verified

198}
199
200function simplify($name,$array=array())
201{
202 $name = strtr($name, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz");
203 $in = ($name[0]=='*');
204 $name = preg_replace('/[^a-z0-9]+/','',$name);
205 $i = 1;
206 if ($name) $id = 'internal-'.$name;
207 //if (strpos($wzid,'R-') === 0) $name = 'r-'.$name;
208 //else if (strpos($wzid,'Cyborg-Wpn-') !== false || strpos($wzid,'Cyb-') || //strpos($wzid,'Cyborg') !== false) $name = 'c-'.$name;
209 $id = $name;
210 while (in_array($id,$array)) $id = $name.(++$i);
211 return $id;
212}
213
214function tourl($id)
215{

Callers 2

r.inc.phpFile · 0.85
commentsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected