How can I check if the var element
exists or not in the array sites
?
var sites = array['test','about','try'];
var element = 'other';
Answer
You can use indexOf()
method like following.
if(sites.indexOf(element) > -1) {
//exist
}
How can I check if the var element
exists or not in the array sites
?
var sites = array['test','about','try'];
var element = 'other';
Answer
You can use indexOf()
method like following.
if(sites.indexOf(element) > -1) {
//exist
}
I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print ...
No comments:
Post a Comment