You haven't included the file that contains the function definition, so it's not available in the scope when you try to call it. You'll need to use include, require, include_once, or require_once.
include basically pulls a file in, adding it's code/content at that point. This is good for importing HTML or template files. If it can't find the file, PHP will issue a warning but try to continue.
include_once behaves the same as include with the addition that it tracks what files have already been included. The file will not be included if it's already been pulled in before, which is useful when it contains function definitions and the like that will raise errors if PHP tries to define them twice.
require and require_once are like their include counterparts, but will raise errors if the file can't be pulled in (maybe the file doesn't exist, for example). These are good when you need to make sure the code is definitely imported or else things won't function correctly (class definitions, function defs, etc.)
So, your fortesting.php file should look like:
<?php
require_once "function.php";
echo randomString();
include/require et al are language constructs not functions, and you can either use parenthesis with them or not depending on your personal preference. That is, require_once "foo.php"; is the same as require_once("foo.php");.
For more information, check out the PHP Manual under the appropriate sections.
Hope this helps!
include('function.php');in fortesting.php