Answers for "undefined variable inside function php"

PHP
0

php variable undefined inside function argument

<?php
    // $ime=$_POST["ime"];
    // $prezime=$_POST["prezime"];
    $pera="string";
    $prezime = "Ne radi, vrati se nazad i unesi nesto!";
    // if (empty($ime)||empty($prezime)){
    //     echo "Ne radi, vrati se nazad i unesi nesto!";
    // }
    $provera = function ($prom) use ($pera) {
        if (preg_match("/[0-9\,\.\?\>\.<\"\'\:\;\[\]\}\{\/\!\\\@\#\$\%\^\&\*\(\)\-\_\=\+\`[:space:]]/",$prom)){
            echo "Nepravilan unos imena ili prezimina!";
            echo $pera;
        }
    };

    // $provera($ime);
    $provera($prezime);
Posted by: Guest on July-07-2021
0

undefined variable inside function php

$myId = 0;
function run(){
  global $myId;
	echo $myId;
}
Posted by: Guest on November-13-2020

Code answers related to "undefined variable inside function php"

Browse Popular Code Answers by Language