59177427 |
1 | <?php |
7350889b |
2 | |
e080b080 |
3 | /** |
35586184 |
4 | * strings.php |
5 | * |
15e6162e |
6 | * Copyright (c) 1999-2002 The SquirrelMail Project Team |
35586184 |
7 | * Licensed under the GNU GPL. For full terms see the file COPYING. |
8 | * |
9 | * This code provides various string manipulation functions that are |
10 | * used by the rest of the Squirrelmail code. |
11 | * |
12 | * $Id$ |
13 | */ |
9374671f |
14 | |
35586184 |
15 | /** |
16 | * SquirrelMail version number -- DO NOT CHANGE |
17 | */ |
18 | global $version; |
ec97f642 |
19 | $version = '1.2.5 [cvs]'; |
d068c0ec |
20 | |
66239b65 |
21 | /** |
22 | * If $haystack is a full mailbox name and $needle is the mailbox |
23 | * separator character, returns the last part of the mailbox name. |
24 | */ |
25 | function readShortMailboxName($haystack, $needle) { |
26 | if ($needle == '') { |
27 | return $haystack; |
28 | } |
29 | $parts = explode($needle, $haystack); |
30 | $elem = array_pop($parts); |
31 | while ($elem == '' && count($parts)) { |
32 | $elem = array_pop($parts); |
33 | } |
34 | return $elem; |
35 | } |
3302d0d4 |
36 | |
66239b65 |
37 | /** |
38 | * If $haystack is a full mailbox name, and $needle is the mailbox |
39 | * separator character, returns the second last part of the full |
40 | * mailbox name (i.e. the mailbox's parent mailbox) |
41 | */ |
42 | function readMailboxParent($haystack, $needle) { |
43 | if ($needle == '') return ''; |
44 | $parts = explode($needle, $haystack); |
45 | $elem = array_pop($parts); |
46 | while ($elem == '' && count($parts)) { |
47 | $elem = array_pop($parts); |
48 | } |
49 | return join($needle, $parts); |
50 | } |
5bdd7223 |
51 | |
66239b65 |
52 | /** |
d8943c57 |
53 | * Returns the index of the first chunk of string $haystack that |
54 | * starts with non-white-space character, starting at position $pos. |
55 | * If there is no such chunk, returns -1. |
66239b65 |
56 | */ |
57 | function next_pos_minus_white ($haystack, $pos) { |
d8943c57 |
58 | $len = strlen($haystack); |
e16d13af |
59 | while ($pos < $len) { |
60 | /* Get the next character. */ |
61 | $c = substr($haystack, $pos, 1); |
62 | |
63 | /* Check the next character. */ |
64 | if (($c != ' ') && ($c != "\t") && ($c != "\n") && ($c != "\r")) { |
d8943c57 |
65 | return $pos; |
66 | } |
e16d13af |
67 | |
68 | /* Increment position in string. */ |
69 | ++$pos; |
66239b65 |
70 | } |
d8943c57 |
71 | return -1; |
66239b65 |
72 | } |
9374671f |
73 | |
66239b65 |
74 | /** |
75 | * Wraps text at $wrap characters |
76 | * |
77 | * Has a problem with special HTML characters, so call this before |
78 | * you do character translation. |
79 | * |
80 | * Specifically, ' comes up as 5 characters instead of 1. |
81 | * This should not add newlines to the end of lines. |
82 | */ |
83 | function sqWordWrap(&$line, $wrap) { |
84 | ereg("^([\t >]*)([^\t >].*)?$", $line, $regs); |
85 | $beginning_spaces = $regs[1]; |
86 | if (isset($regs[2])) { |
87 | $words = explode(' ', $regs[2]); |
88 | } else { |
4deb32f1 |
89 | $words = ''; |
66239b65 |
90 | } |
91 | |
92 | $i = 0; |
93 | $line = $beginning_spaces; |
94 | |
95 | while ($i < count($words)) { |
4deb32f1 |
96 | /* Force one word to be on a line (minimum) */ |
66239b65 |
97 | $line .= $words[$i]; |
98 | $line_len = strlen($beginning_spaces) + strlen($words[$i]) + 2; |
99 | if (isset($words[$i + 1])) |
100 | $line_len += strlen($words[$i + 1]); |
101 | $i ++; |
102 | |
4deb32f1 |
103 | /* Add more words (as long as they fit) */ |
66239b65 |
104 | while ($line_len < $wrap && $i < count($words)) { |
bcad90fe |
105 | $line .= ' ' . $words[$i]; |
106 | $i++; |
66239b65 |
107 | if (isset($words[$i])) |
48f8ce2f |
108 | $line_len += strlen($words[$i]) + 1; |
66239b65 |
109 | else |
110 | $line_len += 1; |
111 | } |
112 | |
4deb32f1 |
113 | /* Skip spaces if they are the first thing on a continued line */ |
66239b65 |
114 | while (!isset($words[$i]) && $i < count($words)) { |
bcad90fe |
115 | $i ++; |
66239b65 |
116 | } |
117 | |
4deb32f1 |
118 | /* Go to the next line if we have more to process */ |
66239b65 |
119 | if ($i < count($words)) { |
5be8bbd8 |
120 | $line .= "\n" . $beginning_spaces; |
66239b65 |
121 | } |
122 | } |
123 | } |
9374671f |
124 | |
23d6bd09 |
125 | |
66239b65 |
126 | /** |
127 | * Does the opposite of sqWordWrap() |
128 | */ |
129 | function sqUnWordWrap(&$body) { |
130 | $lines = explode("\n", $body); |
4deb32f1 |
131 | $body = ''; |
132 | $PreviousSpaces = ''; |
66239b65 |
133 | for ($i = 0; $i < count($lines); $i ++) { |
134 | ereg("^([\t >]*)([^\t >].*)?$", $lines[$i], $regs); |
135 | $CurrentSpaces = $regs[1]; |
136 | if (isset($regs[2])) { |
137 | $CurrentRest = $regs[2]; |
138 | } |
139 | |
140 | if ($i == 0) { |
141 | $PreviousSpaces = $CurrentSpaces; |
142 | $body = $lines[$i]; |
4deb32f1 |
143 | } else if (($PreviousSpaces == $CurrentSpaces) /* Do the beginnings match */ |
144 | && (strlen($lines[$i - 1]) > 65) /* Over 65 characters long */ |
145 | && strlen($CurrentRest)) { /* and there's a line to continue with */ |
66239b65 |
146 | $body .= ' ' . $CurrentRest; |
147 | } else { |
148 | $body .= "\n" . $lines[$i]; |
149 | $PreviousSpaces = $CurrentSpaces; |
150 | } |
151 | } |
152 | $body .= "\n"; |
153 | } |
9374671f |
154 | |
40ee9452 |
155 | |
66239b65 |
156 | /** |
157 | * Returns an array of email addresses. |
158 | * Be cautious of "user@host.com" |
159 | */ |
160 | function parseAddrs($text) { |
4deb32f1 |
161 | if (trim($text) == '') |
66239b65 |
162 | return array(); |
163 | $text = str_replace(' ', '', $text); |
164 | $text = ereg_replace('"[^"]*"', '', $text); |
165 | $text = ereg_replace('\\([^\\)]*\\)', '', $text); |
166 | $text = str_replace(',', ';', $text); |
167 | $array = explode(';', $text); |
168 | for ($i = 0; $i < count ($array); $i++) { |
4deb32f1 |
169 | $array[$i] = eregi_replace ('^.*[<]', '', $array[$i]); |
170 | $array[$i] = eregi_replace ('[>].*$', '', $array[$i]); |
66239b65 |
171 | } |
172 | return $array; |
173 | } |
40ee9452 |
174 | |
66239b65 |
175 | /** |
176 | * Returns a line of comma separated email addresses from an array. |
177 | */ |
178 | function getLineOfAddrs($array) { |
179 | if (is_array($array)) { |
8a549df2 |
180 | $to_line = implode(', ', $array); |
d46b103b |
181 | $to_line = ereg_replace(', (, )+', ', ', $to_line); |
182 | $to_line = trim(ereg_replace('^, ', '', $to_line)); |
183 | if( substr( $to_line, -1 ) == ',' ) |
184 | $to_line = substr( $to_line, 0, -1 ); |
66239b65 |
185 | } else { |
8a549df2 |
186 | $to_line = ''; |
66239b65 |
187 | } |
188 | |
189 | return( $to_line ); |
190 | } |
191 | |
192 | function translateText(&$body, $wrap_at, $charset) { |
4deb32f1 |
193 | global $where, $what; /* from searching */ |
194 | global $color; /* color theme */ |
66239b65 |
195 | |
196 | require_once('../functions/url_parser.php'); |
197 | |
198 | $body_ary = explode("\n", $body); |
199 | $PriorQuotes = 0; |
200 | for ($i=0; $i < count($body_ary); $i++) { |
201 | $line = $body_ary[$i]; |
202 | if (strlen($line) - 2 >= $wrap_at) { |
9374671f |
203 | sqWordWrap($line, $wrap_at); |
66239b65 |
204 | } |
205 | $line = charset_decode($charset, $line); |
206 | $line = str_replace("\t", ' ', $line); |
207 | |
208 | parseUrl ($line); |
209 | |
210 | $Quotes = 0; |
211 | $pos = 0; |
212 | while (1) { |
213 | if ($line[$pos] == ' ') { |
8ceb637a |
214 | $pos ++; |
66239b65 |
215 | } else if (strpos($line, '>', $pos) === $pos) { |
9eea179c |
216 | $pos += 4; |
217 | $Quotes ++; |
66239b65 |
218 | } else { |
219 | break; |
220 | } |
221 | } |
222 | |
223 | if ($Quotes > 1) { |
224 | if (! isset($color[14])) { |
225 | $color[14] = '#FF0000'; |
23d6bd09 |
226 | } |
0391864c |
227 | $line = '<FONT COLOR="' . $color[14] . '">' . $line . '</FONT>'; |
66239b65 |
228 | } elseif ($Quotes) { |
229 | if (! isset($color[13])) { |
230 | $color[13] = '#800000'; |
23d6bd09 |
231 | } |
24194051 |
232 | $line = '<FONT COLOR="' . $color[13] . '">' . $line . '</FONT>'; |
66239b65 |
233 | } |
234 | |
235 | $body_ary[$i] = $line; |
236 | } |
237 | $body = '<pre>' . implode("\n", $body_ary) . '</pre>'; |
238 | } |
9374671f |
239 | |
66239b65 |
240 | function find_mailbox_name ($mailbox) { |
241 | if (ereg(" *\"([^\r\n\"]*)\"[ \r\n]*$", $mailbox, $regs)) |
242 | return $regs[1]; |
243 | ereg(" *([^ \r\n\"]*)[ \r\n]*$",$mailbox,$regs); |
244 | return $regs[1]; |
245 | |
246 | } |
23d6bd09 |
247 | |
43fdb2a4 |
248 | function php_self () { |
249 | global $PHP_SELF, $HTTP_SERVER_VARS; |
250 | |
4deb32f1 |
251 | if (isset($HTTP_SERVER_VARS['REQUEST_URI']) && !empty($HTTP_SERVER_VARS['REQUEST_URI']) ) { |
252 | return $HTTP_SERVER_VARS['REQUEST_URI']; |
253 | } |
254 | |
43fdb2a4 |
255 | if (isset($PHP_SELF) && !empty($PHP_SELF)) { |
256 | return $PHP_SELF; |
257 | } else if (isset($HTTP_SERVER_VARS['PHP_SELF']) && |
258 | !empty($HTTP_SERVER_VARS['PHP_SELF'])) { |
259 | return $HTTP_SERVER_VARS['PHP_SELF']; |
260 | } else { |
261 | return ''; |
262 | } |
263 | } |
264 | |
265 | |
66239b65 |
266 | /** |
267 | * This determines the location to forward to relative to your server. |
268 | * If this doesnt work correctly for you (although it should), you can |
269 | * remove all this code except the last two lines, and change the header() |
270 | * function to look something like this, customized to the location of |
271 | * SquirrelMail on your server: |
272 | * |
273 | * http://www.myhost.com/squirrelmail/src/login.php |
274 | */ |
275 | function get_location () { |
276 | |
277 | global $PHP_SELF, $SERVER_NAME, $HTTP_HOST, $SERVER_PORT, |
278 | $HTTP_SERVER_VARS; |
279 | |
4deb32f1 |
280 | /* Get the path, handle virtual directories */ |
281 | $path = substr(php_self(), 0, strrpos(php_self(), '/')); |
66239b65 |
282 | |
283 | /* Check if this is a HTTPS or regular HTTP request. */ |
284 | $proto = 'http://'; |
285 | |
286 | /* |
287 | * If you have 'SSLOptions +StdEnvVars' in your apache config |
288 | * OR if you have HTTPS in your HTTP_SERVER_VARS |
289 | * OR if you are on port 443 |
290 | */ |
291 | $getEnvVar = getenv('HTTPS'); |
292 | if ((isset($getEnvVar) && !strcasecmp($getEnvVar, 'on')) || |
293 | (isset($HTTP_SERVER_VARS['HTTPS'])) || |
294 | (isset($HTTP_SERVER_VARS['SERVER_PORT']) && |
295 | $HTTP_SERVER_VARS['SERVER_PORT'] == 443)) { |
8a549df2 |
296 | $proto = 'https://'; |
66239b65 |
297 | } |
298 | |
4deb32f1 |
299 | /* Get the hostname from the Host header or server config. */ |
66239b65 |
300 | $host = ''; |
301 | if (isset($HTTP_HOST) && !empty($HTTP_HOST)) { |
302 | $host = $HTTP_HOST; |
303 | } else if (isset($SERVER_NAME) && !empty($SERVER_NAME)) { |
304 | $host = $SERVER_NAME; |
4dc9a365 |
305 | } else if (isset($HTTP_SERVER_VARS['SERVER_NAME']) && |
306 | !empty($HTTP_SERVER_VARS['SERVER_NAME'])) { |
307 | $host = $HTTP_SERVER_VARS['SERVER_NAME']; |
66239b65 |
308 | } |
4dc9a365 |
309 | |
66239b65 |
310 | |
311 | $port = ''; |
312 | if (! strstr($host, ':')) { |
313 | if (isset($SERVER_PORT)) { |
314 | if (($SERVER_PORT != 80 && $proto == 'http://') |
315 | || ($SERVER_PORT != 443 && $proto == 'https://')) { |
316 | $port = sprintf(':%d', $SERVER_PORT); |
317 | } |
318 | } |
319 | } |
320 | |
321 | /* Fallback is to omit the server name and use a relative */ |
322 | /* URI, although this is not RFC 2616 compliant. */ |
323 | return ($host ? $proto . $host . $port . $path : $path); |
324 | } |
dcaf2a49 |
325 | |
9374671f |
326 | |
66239b65 |
327 | /** |
328 | * These functions are used to encrypt the passowrd before it is |
329 | * stored in a cookie. |
330 | */ |
331 | function OneTimePadEncrypt ($string, $epad) { |
332 | $pad = base64_decode($epad); |
333 | $encrypted = ''; |
334 | for ($i = 0; $i < strlen ($string); $i++) { |
335 | $encrypted .= chr (ord($string[$i]) ^ ord($pad[$i])); |
336 | } |
337 | |
338 | return base64_encode($encrypted); |
339 | } |
340 | |
341 | function OneTimePadDecrypt ($string, $epad) { |
342 | $pad = base64_decode($epad); |
343 | $encrypted = base64_decode ($string); |
344 | $decrypted = ''; |
345 | for ($i = 0; $i < strlen ($encrypted); $i++) { |
346 | $decrypted .= chr (ord($encrypted[$i]) ^ ord($pad[$i])); |
347 | } |
348 | |
349 | return $decrypted; |
350 | } |
9374671f |
351 | |
9374671f |
352 | |
66239b65 |
353 | /** |
354 | * Randomize the mt_rand() function. Toss this in strings or integers |
355 | * and it will seed the generator appropriately. With strings, it is |
356 | * better to get them long. Use md5() to lengthen smaller strings. |
357 | */ |
358 | function sq_mt_seed($Val) { |
4deb32f1 |
359 | /* if mt_getrandmax() does not return a 2^n - 1 number, |
360 | this might not work well. This uses $Max as a bitmask. */ |
66239b65 |
361 | $Max = mt_getrandmax(); |
362 | |
363 | if (! is_int($Val)) { |
364 | if (function_exists('crc32')) { |
365 | $Val = crc32($Val); |
366 | } else { |
367 | $Str = $Val; |
368 | $Pos = 0; |
369 | $Val = 0; |
370 | $Mask = $Max / 2; |
371 | $HighBit = $Max ^ $Mask; |
372 | while ($Pos < strlen($Str)) { |
373 | if ($Val & $HighBit) { |
374 | $Val = (($Val & $Mask) << 1) + 1; |
375 | } else { |
376 | $Val = ($Val & $Mask) << 1; |
377 | } |
378 | $Val ^= $Str[$Pos]; |
379 | $Pos ++; |
380 | } |
381 | } |
382 | } |
383 | |
384 | if ($Val < 0) { |
385 | $Val *= -1; |
386 | } |
387 | |
388 | if ($Val = 0) { |
389 | return; |
390 | } |
391 | |
392 | mt_srand(($Val ^ mt_rand(0, $Max)) & $Max); |
393 | } |
9374671f |
394 | |
9374671f |
395 | |
66239b65 |
396 | /** |
397 | * This function initializes the random number generator fairly well. |
398 | * It also only initializes it once, so you don't accidentally get |
399 | * the same 'random' numbers twice in one session. |
400 | */ |
401 | function sq_mt_randomize() { |
402 | global $REMOTE_PORT, $REMOTE_ADDR, $UNIQUE_ID; |
403 | static $randomized; |
404 | |
405 | if ($randomized) { |
406 | return; |
407 | } |
408 | |
409 | /* Global. */ |
410 | sq_mt_seed((int)((double) microtime() * 1000000)); |
411 | sq_mt_seed(md5($REMOTE_PORT . $REMOTE_ADDR . getmypid())); |
412 | |
413 | /* getrusage */ |
414 | if (function_exists('getrusage')) { |
4deb32f1 |
415 | /* Avoid warnings with Win32 */ |
66239b65 |
416 | $dat = @getrusage(); |
417 | if (isset($dat) && is_array($dat)) { |
821a8e9c |
418 | $Str = ''; |
419 | foreach ($dat as $k => $v) |
66239b65 |
420 | { |
421 | $Str .= $k . $v; |
422 | } |
821a8e9c |
423 | sq_mt_seed(md5($Str)); |
66239b65 |
424 | } |
425 | } |
426 | |
4deb32f1 |
427 | /* Apache-specific */ |
66239b65 |
428 | sq_mt_seed(md5($UNIQUE_ID)); |
429 | |
430 | $randomized = 1; |
431 | } |
432 | |
433 | function OneTimePadCreate ($length=100) { |
434 | sq_mt_randomize(); |
435 | |
436 | $pad = ''; |
437 | for ($i = 0; $i < $length; $i++) { |
438 | $pad .= chr(mt_rand(0,255)); |
439 | } |
440 | |
441 | return base64_encode($pad); |
442 | } |
9374671f |
443 | |
66239b65 |
444 | /** |
445 | * Check if we have a required PHP-version. Return TRUE if we do, |
446 | * or FALSE if we don't. |
447 | * |
448 | * To check for 4.0.1, use sqCheckPHPVersion(4,0,1) |
449 | * To check for 4.0b3, use sqCheckPHPVersion(4,0,-3) |
450 | * |
451 | * Does not handle betas like 4.0.1b1 or development versions |
452 | */ |
453 | function sqCheckPHPVersion($major, $minor, $release) { |
454 | |
455 | $ver = phpversion(); |
456 | eregi('^([0-9]+)\\.([0-9]+)(.*)', $ver, $regs); |
457 | |
458 | /* Parse the version string. */ |
459 | $vmajor = strval($regs[1]); |
460 | $vminor = strval($regs[2]); |
461 | $vrel = $regs[3]; |
4deb32f1 |
462 | if($vrel[0] == '.') { |
66239b65 |
463 | $vrel = strval(substr($vrel, 1)); |
464 | } |
465 | if($vrel[0] == 'b' || $vrel[0] == 'B') { |
466 | $vrel = - strval(substr($vrel, 1)); |
467 | } |
468 | if($vrel[0] == 'r' || $vrel[0] == 'R') { |
469 | $vrel = - strval(substr($vrel, 2))/10; |
470 | } |
471 | |
472 | /* Compare major version. */ |
473 | if ($vmajor < $major) { return false; } |
474 | if ($vmajor > $major) { return true; } |
475 | |
476 | /* Major is the same. Compare minor. */ |
477 | if ($vminor < $minor) { return false; } |
478 | if ($vminor > $minor) { return true; } |
479 | |
480 | /* Major and minor is the same as the required one. Compare release */ |
4deb32f1 |
481 | if ($vrel >= 0 && $release >= 0) { /* Neither are beta */ |
66239b65 |
482 | if($vrel < $release) return false; |
4deb32f1 |
483 | } else if($vrel >= 0 && $release < 0) { /* This is not beta, required is beta */ |
66239b65 |
484 | return true; |
4deb32f1 |
485 | } else if($vrel < 0 && $release >= 0){ /* This is beta, require not beta */ |
66239b65 |
486 | return false; |
4deb32f1 |
487 | } else { /* Both are beta */ |
66239b65 |
488 | if($vrel > $release) return false; |
489 | } |
490 | |
491 | return true; |
492 | } |
9374671f |
493 | |
66239b65 |
494 | /** |
495 | * Returns a string showing the size of the message/attachment. |
496 | */ |
497 | function show_readable_size($bytes) { |
498 | $bytes /= 1024; |
499 | $type = 'k'; |
500 | |
501 | if ($bytes / 1024 > 1) { |
502 | $bytes /= 1024; |
503 | $type = 'm'; |
504 | } |
505 | |
506 | if ($bytes < 10) { |
507 | $bytes *= 10; |
508 | settype($bytes, 'integer'); |
509 | $bytes /= 10; |
510 | } else { |
511 | settype($bytes, 'integer'); |
512 | } |
513 | |
514 | return $bytes . '<small> ' . $type . '</small>'; |
515 | } |
9374671f |
516 | |
66239b65 |
517 | /** |
518 | * Generates a random string from the caracter set you pass in |
519 | * |
520 | * Flags: |
521 | * 1 = add lowercase a-z to $chars |
522 | * 2 = add uppercase A-Z to $chars |
523 | * 4 = add numbers 0-9 to $chars |
524 | */ |
9374671f |
525 | |
66239b65 |
526 | function GenerateRandomString($size, $chars, $flags = 0) { |
527 | if ($flags & 0x1) { |
528 | $chars .= 'abcdefghijklmnopqrstuvwxyz'; |
529 | } |
530 | if ($flags & 0x2) { |
531 | $chars .= 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; |
532 | } |
533 | if ($flags & 0x4) { |
534 | $chars .= '0123456789'; |
535 | } |
536 | |
537 | if (($size < 1) || (strlen($chars) < 1)) { |
538 | return ''; |
539 | } |
540 | |
4deb32f1 |
541 | sq_mt_randomize(); /* Initialize the random number generator */ |
66239b65 |
542 | |
4deb32f1 |
543 | $String = ''; |
66239b65 |
544 | while (strlen($String) < $size) { |
545 | $String .= $chars[mt_rand(0, strlen($chars))]; |
546 | } |
547 | |
548 | return $String; |
549 | } |
9374671f |
550 | |
66239b65 |
551 | function quoteIMAP($str) { |
552 | return ereg_replace('(["\\])', '\\\\1', $str); |
553 | } |
1899535f |
554 | |
66239b65 |
555 | /** |
556 | * Trims every element in the array |
557 | */ |
558 | function TrimArray(&$array) { |
559 | foreach ($array as $k => $v) { |
560 | global $$k; |
561 | if (is_array($$k)) { |
562 | foreach ($$k as $k2 => $v2) { |
563 | $$k[$k2] = substr($v2, 1); |
23d6bd09 |
564 | } |
66239b65 |
565 | } else { |
566 | $$k = substr($v, 1); |
23d6bd09 |
567 | } |
66239b65 |
568 | |
4deb32f1 |
569 | /* Re-assign back to array. */ |
66239b65 |
570 | $array[$k] = $$k; |
571 | } |
572 | } |
23d6bd09 |
573 | |
66239b65 |
574 | /** |
575 | * Removes slashes from every element in the array |
576 | */ |
577 | function RemoveSlashes(&$array) { |
578 | foreach ($array as $k => $v) { |
579 | global $$k; |
580 | if (is_array($$k)) { |
581 | foreach ($$k as $k2 => $v2) { |
582 | $newArray[stripslashes($k2)] = stripslashes($v2); |
583 | } |
584 | $$k = $newArray; |
585 | } else { |
586 | $$k = stripslashes($v); |
23d6bd09 |
587 | } |
66239b65 |
588 | |
4deb32f1 |
589 | /* Re-assign back to the array. */ |
66239b65 |
590 | $array[$k] = $$k; |
23d6bd09 |
591 | } |
66239b65 |
592 | } |
23d6bd09 |
593 | |
43fdb2a4 |
594 | $PHP_SELF = php_self(); |
595 | |
15e6162e |
596 | ?> |