From: [EMAIL PROTECTED] Operating system: Windows 98 4.10 english PHP version: 4.0.4 PHP Bug Type: Feature/Change Request Bug description: Suggestions for new functions These are a few suggestions for a new functions. I hope it be useful. Some of them I did myself and it is very useful to me. --------------------------------------------------- 1) Parse variables names inside a string with the actual variables in the current scope: string parse_vars(string $str): An example: $str='Width: $specs[0] pixels (the minimum is $min_width)'; $str2="These \$specs[0] and \$min_width are just examples"; $specs[0]=250; $min_width=300; echo parse_vars($str); echo parse_vars($str2); Will must output: Width: 250 pixels (the minimum is 300) These 250 and 300 are just examples ---------------------------------------------------- 2) Set the PHP internal pointer to point a specific element in an array: mixed setpos(array $arr, mixed $position): function setpos(&$arr,$index) { if(is_array($arr)) { reset($arr); while(list($key,$value)=each($arr)) { if($key==$index) { if(!prev($str)) end($str); return $value; } } } return FALSE; } I did this function to get such functionality. ------------------------------------------------- 3) Simple Left and Right portions of a string: function left($str,$length) { return substr($str,0,$lenght); } function right($str,$lenght) { return substr($str,strlen($str)-$lenght); } PHP have everything to manipulate strings, why do not have these BASIC's string functions too? :-) -------------------------------------------------- 4) A built-in date object Like the javascript date object, with methods to manipulate dates and time, but capable of manipulate years since 1100 to 9999 as MySQL do. The methods must be able to convert different date formats (unix timestamps to sql date format and to user readable formats). -------------------------------------------------- 5) void include_embed(string url): Can read a remote file and embed it in the current web page, like the include() function, but translating all links, images and java's to run as they are in the current web page. The translations will do things like this: In the remote file: <img scr="image.gif"> to: <img src="http://www.remote_address/image.gif"> (The same for forms, java applets, javascripts, Cascade Style Sheets and everything that can be translated). In the case of the links, they should be: <a href="file.html">Click me</a> to: <a href="<?=$PHP_SELF?>?embedurl=http://remote_address/file.html">Click me</a> (this will call a runtime generated php page with an include_embed() on it, which will receive the address from the embedurl variable, and will load the remote file to do the translating again). Regards, Edemilson Lima PS: the functions names are just suggestions too. ;-) -- Edit Bug report at: http://bugs.php.net/?id=10596&edit=1 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]