I have the following string in a text file:
^b^B
I'm trying to split this into two variables. My current code is using explode() but it does not work as I want it to:
$num1 = '^b';
$num2 = '^B';
How can I accomplish this using PHP?
THIS IS MY CODE
<?php
if(isset($_POST['refresh'])) {
exec('/var/www/www.rfteste.com/htdocs/estado.sh');
}
if(isset($_POST['on'])) {
exec('/var/www/www.rfteste.com/htdocs/on.sh');
}
if(isset($_POST['off'])) {
exec('/var/www/www.rfteste.com/htdocs/off.sh');
}
echo "<H3>CONTROL PANEL</H3>";
$str = file_get_contents("/var/www/www.rfteste.com/htdocs/refresh.txt");
$vals = explode("^", $str);
$num1 = "^".$vals[0];
$num2 = "^".$vals[1];
$onoff= "^A";
if($num2 == $onoff)
echo "<b>on</b>";
else
echo "<b>off</b>";
?>
<html>
<body>
<form method="post" action="">
<p>
<center><input type="submit" value="on" name="on""';" /></center>
<center><input type="submit" value="off" name="off""';" /></center>
<center><input type="submit" value="refresh" name="refresh""';" /></center>
