php - What is wrong with my function? (new to user defined functions) -


i trying post previous page form on it, , rather typing out code on , on again tried making function it, didnt work. in advance

function postorempty($field){ isset($_post[$field]) ? $_post[$field] : ""; }  $szfname= postorempty('fname'); 

you not return value. try add return keyword.

function postorempty($field) {     return (isset($_post[$field]) ? $_post[$field] : ""); }  $szfname= postorempty('fname'); 

Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

aspxgridview - Devexpress grid - header filter does not work if column is initially hidden -

c# - How to execute a particular part of code asynchronously in a class -