Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

how can i check that a json file already has something inside

cdia = open('CDIA.json', 'r')
data = json.load(cdia)

def Check(x):
    for i in data['CDIA']:
        if x == i['name']:
            return True
    return False

name = input('[?] Enter your name: ')
if Check(name):
    print('[!] The name is already registered.')
else:
    print("[!] The name isnt registered yet.")
 
PREVIOUS NEXT
Tagged: #check #json #file
ADD COMMENT
Topic
Name
1+7 =