Function: replace

Usage: @replace(String to_modify, String from, String to) Searches for the string $from in $to_modify and replaces it by $to.
If $from is empty, Cws will output an error. <#cws
$Path_to_include = "/includes/" + @replace($GET_page, "/", "")
// consider $GET_page is "../config.cws"
$data = @include($Path_to_include)
if_not_null($data, @print($data), @include("404eror.html"))
This will replace every '/' in $GET_page by nothing. Note that there's another function to do this: securize. It runs faster than this.
The script will attempt to include the $Path_to_include. I it can't include it, it will include 404error.html

See also