Can I get variables from a shell script into php variables

how about this

test.sh


#!/bin/sh

re=x
echo $re
export re

and the php


<?php

function render()
{
	$cmd = "sh test.sh";

    system($cmd);

    echo getenv("re");
}

render();