I am using PHP conditions and want to know if I can run a JavaScript function without some one have to click on it using JavaScript:
if($value == 1)
First of all keep in mind that your PHP code is evaluated on the server, while JavaScript runs in the browser on the client-side. These evaluations happen in different places, at different times. Therefore you cannot call a JavaScript function from PHP.
However with PHP you can render HTML and JavaScript code such that it is only rendered when your PHP condition is true. Maybe you may want to try something like this:
if($value == 1) {
echo "";
}