InfoTechSite https://www.siteforinfotech.com CS/IT Tutorials, MCQs, Guides And Reviews Wed, 28 Oct 2020 17:26:40 +0000 en-US hourly 1 https://wordpress.org/?v=5.5.2 https://www.siteforinfotech.com/wp-content/uploads/2017/11/cropped-infotechsite-logo2-150x150.png InfoTechSite https://www.siteforinfotech.com 32 32 Top 20 MCQ Questions on Handling Files in PHP https://www.siteforinfotech.com/mcq-questions-on-handling-files-in-php/ https://www.siteforinfotech.com/mcq-questions-on-handling-files-in-php/#respond Wed, 28 Oct 2020 17:17:36 +0000 https://www.siteforinfotech.com/?p=9037 Here are the collections of top 20 MCQ questions on handling files in PHP includes multiple-choice questions on fundamentals of file handling in PHP. It includes MCQ questions on retrieving a path’s filename and directory, identifying the absolute path, calculating file, directory, and disk sizes, determining access and modification times, opening and closing files, reading file contents into a string variable and moving the file pointer in PHP.

Read Also: Top 20 MCQ Questions on Handling Strings in PHP

1) The pathinfo() function creates an associative array containing which of the following components of a path.
i. Directory Name
ii. Base Name
iii. File extension
A. i and ii only
B. ii and iii only
C. i and iii only
D. All i, ii and iii

2) The … function converts all symbolic links and relative path reference located in the path to their absolute counterparts.
A. realpath()
B. relativepath()
C. absolutepath()
D. path()

3) The … function returns a file’s last access time in UNIX timestamp format or FALSE on error.
A. unixtime()
B. fileatime()
C. filetime()
D. filectime()

4) The … function returns a file’s last changed time in UNIX timestamp format or FALSE on error.
A. unixtime()
B. fileatime()
C. filetime()
D. filectime()

5) The … function returns a file’s last modification time in UNIX timestamp format or FALSE otherwise.
A. unixtime()
B. fileatime()
C. filetime()
D. filectime()

6) Which of the following are the modes that are assigned at the time a resource is opened while reading and manipulation a file using the fopen() function.
i. r
ii. R
iii. a+
iv. X
A. i, ii and iii only
B. ii, iii and iv only
C. i, iii and iv only
D. All i, ii, iii and iv

7) State whether the following statements about opening a file with fopen() function are TRUE or FALSE.
i. The X mode will create and open the file for writing only.
ii. In the a+ mode, the file pointer is placed at the rare part of the file with the read and write feature enabled.
iii. In the X+ mode, if the file exists, fopen() will fail and an error of level E_WARNING will be generated.
A. i-True, ii-True, iii-False
B. i-False, ii-True, iii-True
C. i-True, ii-False, iii-True
D. i-False, ii-False, iii-True

8) The … function is capable of reading a file into an array, separating each element by the newline character.
A. file()
B. fgets()
C. fgetc()
D. readfile()

9) The … function reads the contents of a file into a string.
A. file()
B. fgets()
C. file_get_contents()
D. readfile()

10) The … function returns a certain number of characters read in through the opened resource handle or everything it has read up to the point when a new line or an EOF character is encountered.
A. file()
B. fgets()
C. file_get_contents()
D. readfile()

11) The … function returns a certain number of characters read in through the opened resource handle or everything it has read up to the point when a new line or an EOF character is encountered.
A. file_get_contents()
B. fgets()
C. fgetc()
D. readfile()

12) The … function reads an entire file specified by filename and immediately outputs it to the output buffer, returning the number of bytes read.
A. fscanf()
B. fgets()
C. fread()
D. readfile()

13) The … function offers a convenient means for parsing a resource in accordance with a predefined format.
A. fscanf()
B. fgets()
C. fread()
D. readfile()

14) The … function retrieves the current position of the file pointers offset within the resource.
A. fscanf()
B. ftell()
C. fseek()
D. rewind()

15) The … function returns an array consisting of files and directories found in the directory or returns FALSE on error.
A. fscanf()
B. scandir()
C. readdir()
D. rewind()

16) The … function sets the file filenames last modified and last accessed times, returning TRUE on success or FALSE on error.
A. fscanf()
B. ftell()
C. setf()
D. touch()

17) You can use the… function to list all files and child directories in a given directory.
A. fscanf()
B. scandir()
C. readdir()
D. rewind()

18) The … function moves the pointer to the location specified by a provided offset value.
A. fscanf()
B. ftell()
C. fseek()
D. rewind()

19) The … function returns the total size, in bytes, consumed by the disk partition housing a specified directory.
A. total_space()
B. disk_space()
C. disk_space_total()
D. disk_total_space()

20) The … function operates similarly to fgets(), except that if also strips any HTML and PHP tags from the input.
A. fgetss()
B. fgetsh()
C. fgetsp()
D. fgetst()

Answers

  1. D. All i, ii and iii
  2. A. realpath()
  3. B. fileatime()
  4. D. filectime()
  5. C. filetime()
  6. B. ii, iii and iv only
  7. C. i-True, ii-False, iii-True
  8. A. file()
  9. C. file_get_contents()
  10. B. fgets(0
  11. C. fgetc()
  12. D. readfile()
  13. A. fscanf()
  14. B. ftell()
  15. B. scandir()
  16. D. touch()
  17. C. readdir()
  18. C. fseek()
  19. D. disk_total_space()
  20. A. fgetss()
]]>
https://www.siteforinfotech.com/mcq-questions-on-handling-files-in-php/feed 0
How to make money writing as a freelance writer? https://www.siteforinfotech.com/make-money-writing-as-a-freelance-writer/ https://www.siteforinfotech.com/make-money-writing-as-a-freelance-writer/#respond Tue, 27 Oct 2020 15:42:36 +0000 https://www.siteforinfotech.com/?p=9027 Making money with writing as a freelance writer is enticing for many. The opportunity to work remotely, choose the projects and clients to work with, and manage the workload attracts both professional writers and those new in the writing field. Yet, if you only consider working self-employed with writing as a freelance writer, you might not be aware of the wealth of opportunities that this path has to offer.

Today’s article will share possible ways of earning money with writing as a freelance writer. Whether you consider writing as a side affair or would like to turn it into a full-time career, you’ll definitely find some new options you haven’t thought of before.

Read Also: What Are Most Trusted Ways of Making Money Online

How to earn money with writing as a freelance writer?

Choose your niche (and become an expert)

When you’re only starting a writing career, it makes sense to take every assignment that comes your way just to gain experience. But later on, you should choose the niche you’ll specialize in. The best writers aren’t Jacks of all trades. They know ins and outs of one specific industry and that’s what makes them valuable professionals. You can choose the preferred topics or specialize in a particular type of writing (such as eBooks, website and blog content, white papers, magazine articles, etc.).

Sign up for the freelance website

The fastest way to start off your career is to offer your services on the website where clients lookup for freelancers. Upwork, Fiverr and Simply Hired are examples of the large freelancer platform. Yet, you might want to sign up for the local or specialized freelance job sites as well. Be sure to complete your online profile carefully and attach the portfolio of works. It will help persuade the clients to hire you over other freelancers.

Advertise your services online

Once you’ve decided to earn money writing, spread the word about it online and in-person. Inform everyone in your network so that the people you already know could use your services or recommend you to someone who is in need of writing. People are more willing to hire a freelancer they know rather than a complete stranger. So, you’ll find it much easier to get your first projects if you tap your network or ask someone to recommend you.

Customize your proposals

Finding your first clients might be tough. Yet, avoid approaching all potential clients with the same cookie-cutter letter. Customize your proposal for each particular project, pointing out that you’ve understood the assignment and know how to approach the task effectively. Explain how your background can be valuable for the client and why they should hire you. Clients can tell customized proposals from generic ones, and favor those freelancers who took time to learn more about the project before applying.

Join the academic writing company

If you want to be an academic writer who specializes in writing college essays and English research papers, you’ll need to sign up for the specific academic paper writing company. Such essay companies assist students from the US and beyond with their papers, homework, and other assignments given by instructors. Since clients are US students, you need to be a native English speaker and have a good command of at least one academic subject. An essay service usually has tight deadlines for assignments so you’ll need strong organizational skills as well.

Build long-term client relationships

Your goal as a freelancer is to get more well-paying clients and to achieve it, you’ll need to build relationships with them. As you work for a client, ask them to provide feedback. If they’re happy with the work you’ve done, don’t be shy to approach them for more projects or ask to recommend your services to someone. If people enjoy working with you and you make an impression of a competent and reliable writer, you’ll find it easy to build a steady client base.

Never stop learning

Making money with writing as a freelance writer is about ongoing learning and expanding your skills. You’ll need to grow your knowledge in a particular niche to broaden your expertise and charge more for your services. If you decide to specialize in copywriting, for instance, you’ll need a bunch of other skills in addition to writing. These skills include SMM, keyword optimization, basics of online marketing, and more. The key idea here is that the more you are educated in some field and the more extra skills you have, the higher pay you can charge for your services

]]>
https://www.siteforinfotech.com/make-money-writing-as-a-freelance-writer/feed 0
Top 20 MCQ Questions on Handling Strings in PHP https://www.siteforinfotech.com/mcq-questions-on-handling-string-in-php/ https://www.siteforinfotech.com/mcq-questions-on-handling-string-in-php/#respond Sat, 24 Oct 2020 12:18:58 +0000 https://www.siteforinfotech.com/?p=8989 This set of MCQ questions on handling strings in PHP includes the collections of the top 20 multiple-choice questions on the fundamentals of handling strings in PHP. It includes objective type questions on comparing two strings case-sensitively and case-insensitively, calculating the similarity and differences between two strings, manipulating string case, converting strings to and from HTML, tokenizing a string based on predefined characters, exploding a string based on a predefined delimiter, and retrieving part of a string.

Read Also: Top 20 MCQ Questions on Perl Regular Expressions in PHP

1) The … function performs a binary-safe, case sensitive comparison of two strings.
A. strspn()
B. strcspn()
C. strcmp()
D. strcomp()

2) The … function performs a case insensitive comparison of two strings.
A. strcaseicmp()
B. strcasecmp()
C. strcasecomp()
D. strspn()

3) The functions returs the length of the first segment of the string containing characters not found in another string.
A. strspn()
B. strcspn()
C. strcmp()
D. strcomp()

4) The functions returs the length of the first segment of the string containing characters also found in another string.
A. strspn()
B. strcspn()
C. strcmp()
D. strcomp()

5) The … function capitalizes the first letter of the string str if it is alphabetical.
A. strcap()
B. firstcap()
C. ucfirst()
D. ucasefirst()

6) The … function capitalizes the first letter of each word in a string.
A. ucwords()
B. firstcap()
C. ucfirst()
D. ucasewords()

7) The … function converts all newline (/n) characters in a string to their XHTML compliant equivalent, <br/>.
A. newline()
B. break()
C. nl2br()
D. nlbr()

8) Which of the following characters that htmlspacechars() can convert.
i. & (ampersand)
ii. ” (double quote)
iii. ‘ (Single quote)
A. i and ii only
B. i and iii only
C. ii and iii only
D. All i, ii and iii

9) The … function will delete all the HTML and PHP tags from the string altogether.
A. strip_tags()
B. delete_tags()
C. tags_strip()
D. tags_delete()

10) You can translate text to its HTML equivalent using the … function.
A. translate_text()
B. html_translation_text()
C. html_translation_table()
D. get_html_translation_table()

11) The … is capable of reversing the text-to-html translation and vice-versa.
A. translate_text_html()
B. html_translation_text()
C. html_text_flip()
D. array_flip()

12) The … function converts all characters in a string to their corresponding match found in a predefined array.
A. array_str()
B. strtr()
C. strtok()
D. array_flip()

13) The … function parses the string based on a predefined list of characters.
A. strstr()
B. strtr()
C. strtok()
D. strpos()

14) The … function finds the position of the first case-sensitive occurrence of a substring in a string.
A. strstr()
B. strtr()
C. strtok()
D. strpos()

15) The … function finds the position of the last occurrence of a string returning its numerical position.
A. strstr()
B. strtr()
C. strrpos()
D. strpos()

16) The … function returns the remainder of a string beginning with the first occurrence of a predefined string.
A. strstr()
B. strtr()
C. substr()
D. substr_count()

17) The … function returns the part of a string located between a predefined starting offset and length positions.
A. strstr()
B. strtr()
C. substr()
D. substr_count()

18) The … function returns the number of times one string occurs within another.
A. strstr()
B. strtr()
C. substr()
D. substr_count()

19) The … function removes various characters from the beginning of a string, including white space, the horizontal tab(\t), newline(\n), carriage return(\r), Null(\o), and vertical tab(\xob).
A. rtrim()
B. ltrim()
C. trim()
D. ctrim()

20) The function … offers information regarding the total number of words found in a string.
A. str_word_count()
B. str_count()
C. word_count()
D. count_words()

Answers

  1. C) strcmp()
  2. B) strcasecmp()
  3. B. strcspn()
  4. A. strspn()
  5. C. ucfirst().
  6. A. ucwords()
  7. C. nl2br()
  8. D. All i, ii and iii
  9. A. strip_tags()
  10. D. get_html_translation_table()
  11. D. array_flip()
  12. B. strtr()
  13. C. strtok()
  14. D. strpos()
  15. C. strrpos()
  16. A. strstr()
  17. C. substr()
  18. D. substr_count()
  19. B. ltrim()
  20. A. str_word_count()

]]>
https://www.siteforinfotech.com/mcq-questions-on-handling-string-in-php/feed 0
7 Invaluable Techniques to Improve Regex Performance https://www.siteforinfotech.com/techniques-to-improve-regex-performance/ https://www.siteforinfotech.com/techniques-to-improve-regex-performance/#respond Fri, 23 Oct 2020 06:03:40 +0000 https://www.siteforinfotech.com/?p=8981 Regular expressions or ‘regex’ for short, are very powerful but using them needs a lot of practice. Because of how most regex engines operate, it becomes surprisingly easy to create a regular expression that will take a long time to run. It’s important for you to learn certain techniques that will improve regex performance to make your regex run faster and more effectively.

Why do you need to improve your Regex performance?

Having a well-organized regex engine allows you to look at your pattern while being more forgiving. As an analogy, try to picture a town. The engine recognizes a lot of foreigners in town and even if you cannot express yourself well to them, they can still appreciate your effort. They will try to understand what you’re saying to make communication work between you.

Optimizing your regex expressions means learning tricks and techniques to “speak” to uncivilized or impolite regex engines. Therefore, optimizing your regex compels you to write expressions that are much harder to read and write. 

Of course, this can be a little bit unfair too. Despite all of this, studying how to optimize your regex can be a fun and useful experience. A study of optimization will help deepen your comprehension of how the engine works and this knowledge will enable you to construct your expressions more accurately and at a faster rate.

Read Also: Top 20 MCQ Questions on POSIX Regular Expressions in PHP

How to improve Regex performance?

Whenever you have to deal with regex, you will always want to improve its performance. For this, you can make your own regular expressions cheat sheet that includes the following techniques:

1. Character Classes

This is perhaps the most crucial thing to remember when writing performance regexes. Character classes specify which characters you are or aren’t trying to match. The more specific you are, the better. Using a specific character class gives you control over the number of characters that will cause the regex engine to use, thus, allowing you to prevent rampant backtracking.

2. Ordering Alterations

This happens when a regex has two or more valid options separated by the “|” character. The order also matters if you have several lookbehinds and lookaheads. Your objective is to arrange each option in such a way that it minimizes the amount of work that the regex engine must perform. For alterations, you should prioritize the most common option, followed by the rarer options. If you do it the other way around, the regex engine will have to take time checking the rarer options before checking more common options, which have a higher likelihood of success.

3. Expose Literal Characters

When literal characters and anchors appear in the main pattern instead of getting buried in sub-expressions, the regex engines can make matches faster. Therefore, it’s recommended to expose these literal characters whenever you can by taking them out of a quantified expression or an alteration.

4. Anchors and Boundaries

These inform the regex engine that you want the cursor to be in a certain place in the string. The “$” and “^” are the most common anchors, which indicate a line’s beginning and end. Common boundaries are the non-word boundary “\B” and the word boundary “\b.” Use anchors whenever possible, especially when considering the effect on performance.

Read Also: Top 20 MCQ Questions on Perl Regular Expressions in PHP

5. Lazy Quantifiers

This is a huge performance enhancer. In several naive regexes, you can safely replace greedy quantifiers (*’s) using lazy quantifiers (*? ’s). This gives the regex a performance boost without altering the result.

6. Possessive Quantifiers

You denote possessive quantifiers with a “+”) sign while you denote atomic groups with “?>…”). These two have the same function. After consuming text, they won’t let go. 

This can be a significant advantage for performance reasons since it helps reduce backtracking. But your regex already has to be fairly specific for you to use atomic groups. As such, your performance boost won’t be as much. However, the possessive quantifier can be surprisingly useful.

7. Practice Benchmarking

All regex engines vary from one another. They utilize various algorithms, have varying internal organizations and different sets of operators. You need to know their characteristics and the benchmark on the engine to use for the regex engine to become efficient. 

It takes time to write a precise pattern but this helps prevent your engine from backtracking. Benchmarking requires more effort, but this helps in preventing the degradation of performance on production. 

Furthermore, an understanding of the regex engine implementation will take you away from coding, but it will provide you more confidence in terms of using tools.

Conclusion

Regex performance is a very interesting subject. For many, they only use regex in special circumstances where they need to solve specific types of issues. Under normal conditions, it really will not matter if a regex doesn’t run as fast. Those who develop latency-sensitive applications don’t like to use regex because of their notoriously slow character. But if the regex is the only tool that can get the job done, you can use the tips you learned here.

]]>
https://www.siteforinfotech.com/techniques-to-improve-regex-performance/feed 0
Top 20 MCQ Questions on Perl Regular Expressions in PHP https://www.siteforinfotech.com/mcq-questions-on-perl-regular-expressions/ https://www.siteforinfotech.com/mcq-questions-on-perl-regular-expressions/#respond Wed, 21 Oct 2020 17:44:16 +0000 https://www.siteforinfotech.com/?p=8969 Here are the collections of top 20 MCQ questions on Perl regular expressions in PHP includes multiple-choice questions on PHP’s Perl based regular expression. It includes MCQ questions on different types of quantifiers, modifiers, and metacharacters used on Perl based regular expressions. It also includes objective questions on different functions available in Perl compatible regular expressions.

Read Next: Top 20 MCQ Questions on POSIX Regular Expressions in PHP

1) … is the modifier of Perl based regular expression in PHP which will ignore white space and comments within the regular expression.
A. S
B. X
C. U
D. M

2) … is the modifier of Perl based regular expression in PHP which will match the pattern as many times as possible rather than just stop the first match.
A. S
B. X
C. U
D. M

3) The modifier… will allow for ^ and $ to match at the beginning of any line in a string.
A. S
B. X
C. U
D. M

4) State, whether the following statements about the modifiers of Perl-based regular expressions are TRUE or FALSE.
i. The modifier I will perform a case-insensitive search.
ii.The modifier S will perform a case-sensitive search.
A. i-True, ii-False
B. i-False, ii-True
C. i-False, ii-False
D. i-True, ii-True

5) State, whether the following statements about metacharacters of Perl-based regular expressions are TRUE.
i. \A matches only at the beginning of the string.
ii. \b matches anything but a word boundary.
iii. \d matches a digit character.
A. i and ii only
B. ii and iii only
C. i and iii only
D. All i, ii and iii

6) The metacharacter … will matches a string, omitting the underscore and alphanumeric characters.
A. \w
B. \W
C. \M
D. \N

7) The metacharacter … in Perl based regular expression is the same as [a-zA-Z0-9].
A. \w
B. \W
C. \M
D. \N

8) PHP offers … functions for searching and modifying strings using Perl compatible regular expressions.
A. six
B. seven
C. eight
D. nine

9) The … function searches all elements of an array, returning an array consisting of all elements matching a certain pattern.
A. preg_grep()
B. preg_match()
C. preg_match_all()
D. preg_filter()

10) The … function searches a string for a specific pattern, returning TRUE if it exists and FALSE otherwise.
A. preg_grep()
B. preg_match()
C. preg_match_all()
D. preg_filter()

11) The … function searches a string for a specific pattern, returning TRUE if it exists and FALSE otherwise.
A. preg_grep()
B. preg_match()
C. preg_match_all()
D. preg_filter()

11) The … function inserts a backslash delimiter before every character of special significance to regular expression syntax.
A. preg_replace()
B. preg_match()
C. preg_match_all()
D. preg_quote()

12) The regular expression will match strings such as ‘limb’ and ‘timb’ but not ‘mbbs’.
A. /mb\B/
B. /mb\b/
C. /mb\A/
D. /mb\d/

13) State, whether the following statements about metacharacters in regular expressions are TRUE or FALSE.
i. $ matches the end of a line.
ii. / quotes the next metacharacter.
iii. [] encloses a character grouping.
A. i-True, ii-False, iii-True
B. i-True, ii-True, iii-True
C. i-Ture, ii-True, iii-False
D. i-False, ii-Ture, iii-False

14) … is the modifier of Perl based regular expression in PHP which treats the string as a single line, ignore any newline characters found within.
A. S
B. X
C. N
D. M

15) … will match en, whether the string appears in isolation or is followed by one or more characters.
A. /en/
B. /en+/
C. /en*/
D. /en{1}/

16) The regular expression … returns the first case-insensitive occurance of the word ‘perl’.
A. /\bperl\b/i
B. /perl/i
C. /perl\b/i
D. /\Bperl\B/i

17) Which of the following is the correct syntax of using the function preg_quote().
A. string preg_quote(string pattern, string str [, string delimeter])
B. string preg_quote(string str [, string delimeter])
C. string preg_quote(mixed str [, string delimeter])
D. string preg_quote(string pattern [, string delimeter])

18) The … functions replaces all occurrences of pattern with replacement and returns the modified result.
A. preg_replace()
B. preg_replace_all()
C. preg_replace_callback()
D. pret_replace_pattern()

19) State, whether the following statements about splitting a string into various elements are TRUE or FALSE.
i. The preg_split() function operates exactly like split().
ii. In preg_split() function, the pattern can also be defined in terms of the regular expression.
A. i-True, ii-False
B. i-False, ii-True
C. i-False, ii-False
D. i-True, ii-True

20) The … function operates in a fashion identical to the preg_replace() function, except that, rather than returning a modified result, only matches are returned.
A. preg_filter()
B. preg_replace_all()
C. preg_replace_callback()
D. pret_replace_pattern()

Answers

  1. B. X
  2. C. U
  3. D. M
  4. A. i-True, ii-False
  5. C. i and iii only
  6. B. \W
  7. A. \w
  8. C. eight
  9. A. preg_grep()
  10. B. preg_match()
  11. D. preg_quote()
  12. B. /mb\b/
  13. C. i-Ture, ii-True, iii-False
  14. A. S
  15. B. /en+/
  16. A. /\bperl\b/i
  17. B. string preg_quote(string str [, string delimeter])
  18. A. preg_replace()
  19. D. i-True, ii-True
  20. A. preg_filter()

Read Next: Top 20 MCQ Questions on Handling Strings in PHP

]]>
https://www.siteforinfotech.com/mcq-questions-on-perl-regular-expressions/feed 0
Top 20 MCQ Questions on POSIX Regular Expressions in PHP https://www.siteforinfotech.com/mcq-questions-on-posix-regular-expressions/ https://www.siteforinfotech.com/mcq-questions-on-posix-regular-expressions/#respond Mon, 19 Oct 2020 16:16:17 +0000 https://www.siteforinfotech.com/?p=8952 Here are the collections of top 20 MCQ questions on POSIX regular expressions in PHP includes multiple-choice questions on fundamentals of regular expressions syntax in POSIX format. It includes MCQ questions on POSIX implementation of the regular expression such as brackets, quantifiers, and predefined character classes used on PHP.

It also includes objective type questions on different PHP’s regular expression functions for performing case-sensitive and case-insensitive search along with splitting the string into various elements based on case sensitive and case-insensitive patterns.

Read Also: Top 20 MCQ Questions on Exception Handling in PHP

1) The POSIX implementation of regular expression was deprecated in the PHP version…
A. 5.2
B. 5.3
C. 5.4
D. 6

2) State whether the following statements about regular expression are TRUE or FALSE.
i. A regular expression is nothing more than a pattern of characters itself that was matched against a certain parcel of text.
ii. It may be a pattern with which you are already familiar or it may be a pattern with specific meaning in the context of the word of pattern matching.
A. i-True, ii-False
B. i-False, ii-True
C. i-False, ii-False
D. i-True, ii-True

3) … are used to represent a list or range of characters to be matched.
A. []
B. {}
C. ()
D. /*

4) In PHP’s regular expression, … matches any string containing at least one a.
A. a*
B. a
C. a+
D. a{1}

5) The regular expression, … matches any string containing zero or more a’s.
A. a*
B. a
C. a+
D. a{1}

6) The regular expression, … matches any string containing zero or one a.
A. a*
B. a
C. a+
D. a?

7) The … matches any string not containing any of the characters ranging from a through z and A through Z.
A. [a-zA-Z]
B. {^a-zA-Z}
C. [^a-zA-Z]
D. [^a-z-A-Z]

8) … matches any string containing a ‘b’ followed by zero or more instances of the sequence of ‘ag’.
A. b[ag]
B. b(ag)+
C. b(ag)
D. b(ag)*

9) … matches any string inclosed within <i> and </i>.
A. <i>(.*)</i>
B. <i>[.*]</i>
C. <i>(.?)</i>
D. <i>[*]</i>

10) The predefined character class … specifies the lowercase and uppercase alphabetical characters and numeric digits.
A. [:alpha:]
B. [:graph:]
C. [:alnum:]
D. [:num:]

11) The predefined default character class … can also be specified as [A-Za-z].
A. [:alpha:]
B. [:graph:]
C. [:alnum:]
D. [:num:]

12) The predefined default character class … specifies printable characters found in the range of ASCII 33 to 126.
A. [:alpha:]
B. [:graph:]
C. [:alnum:]
D. [:char:]

13) PHP offers …. functions for searching strings using POSIX style regular expressions.
A. five
B. six
C. seven
D. eight

14) The PHP’s regular expression function, … executes a case-sensitive search of string for a defined pattern.
A. eregi()
B. ereg()
C. regi()
D. regse()

15) You can perform case insensitive search with the function … in PHP’s regular expression.
A. eregi()
B. ereg()
C. regi()
D. regse()

16) The … function will be useful when checking the validity of strings, such as passwords.
A. eregi()
B. ereg()
C. regi()
D. regse()

17) The … function will split a string into various elements based on case insensitive pattern.
A. eregi()
B. ereg()
C. split()
D. spliti()

18) The … function converts each character in a string into a bracketed expression containing two characters.
A. eregi()
B. eregcase()
C. sql_regcase()
D. regcase()

19) The predefined character class … will specify whitespace characters, including space, horizontal tab, vertical tab, newline, form feed, or carriage return.
A. [:tab:]
B. [:space:]
C. [:whitespace:]
D. [:char:]

20) The regular expression … will match any string containing exactly three characters.
A. ^.{3}$
B. ^.{3}
C. {3}$
D. *{3}$

Answers

  1. B. 5.3
  2. D. i-True, ii-True
  3. A. []
  4. C. a+
  5. A. a*
  6. D. a?
  7. C. [^a-zA-Z]
  8. D. b(ag)*
  9. A. <i>(.*)</i>
  10. C. [:alnum:]
  11. A. [:alpha:]
  12. B. [:graph:]
  13. C. seven
  14. B. ereg()
  15. A. eregi()
  16. A. eregi()
  17. D. spliti()
  18. C. sql_regcase()
  19. B. [:space:]
  20. A. ^.{3}$

Read Next: Top 20 MCQ Questions on Perl Regular Expressions in PHP

]]>
https://www.siteforinfotech.com/mcq-questions-on-posix-regular-expressions/feed 0
4 Benefits of a Private Cloud to Protect Your Data https://www.siteforinfotech.com/benefits-of-a-private-cloud/ https://www.siteforinfotech.com/benefits-of-a-private-cloud/#respond Sat, 17 Oct 2020 12:54:27 +0000 https://www.siteforinfotech.com/?p=8933 A business that has valuable workloads or customization necessities need protection to their files. Imagine knowing someone has broken into your office and has hacked all of your system and data. So, the key point is to have a strong cloud system to store your files and data. And you can use that to back up your work and save your company.

There are numerous causes of a business being breached and losing all of their hard work for several years. To minimize the risk of a hack, you have to be careful and need to be aware of the system that can give you the required security and benefit of keeping your data safe.

This article will guide you through some information regarding the cloud system and how it benefits your business.

Types of Clouds

There are two types of clouds, which are private and public clouds. The main difference between using a private or public cloud depends on the type of business you run. It all depends on the necessities of your corporate. Therefore you can choose either of them or both. Companies that have both facilities are users of hybrid cloud.

Average to large businesses usually opt for the private cloud because it provides better protection and security to your sensitive data. With a high customer data capacity, business plan ideas, and confidential records, such companies need a sound defense system.

If your business is flexible to use both, you can switch to a hybrid cloud, but a private cloud is better for you if you need full control of your data.

Benefits of a Private Cloud

The following are the benefits of a private cloud for better flexibility, security, stability, customization, control, and backup of your data.

Stability of Private Cloud

As clouds have saved you from using a hard drive, USB, computers, flash drives, and other devices to store your data. It still needs a device to keep your information in its storage. Private clouds are convenient because you have everything in one place, which gives you control over the system.
However, for the best security, you need to have better protocols in place to save you from having a disaster so you can recover your files through backup. Serverspace cloud gives you the best security for your private files so that nothing can affect your system no matter who is using it.

Read Also: How To Keep Your Devices Protected With Virtual Offices Increasing?

Customize Your Private Cloud

You can use the private cloud facility according to your business needs. They can work properly with any industry’s objectives and reliable factors. You can customize its usage and make it easy for you to control every situation in normal or critical cases.

Look at what your company requires and decide what works best for you based on security and availability.

A Good Backup System

A major benefit that your private cloud gives you is that you can relocate all your data in case the server goes down. All of your data can be found on the backup storage system, making it available to you all the time.

It has a great support system that gives you all your data back because you have stored it through a backup program.

Conclusion

Businesses everywhere need a safe way to store and access their data with a secure service provider. More companies need a better way to manage their teams and workloads. With such increased value, you need the help of private clouds more than ever to protect your data.

Read Next: Cloud-Based POS System: What are the Benefits of it?

]]>
https://www.siteforinfotech.com/benefits-of-a-private-cloud/feed 0
Top 20 MCQ Questions on Exception Handling in PHP https://www.siteforinfotech.com/mcq-questions-on-exception-handling-in-php/ https://www.siteforinfotech.com/mcq-questions-on-exception-handling-in-php/#respond Sat, 17 Oct 2020 02:51:34 +0000 https://www.siteforinfotech.com/?p=8912 Here are the collections of top 20 MCQ questions on exception handling in PHP includes multiple-choice questions on fundamentals of exception handling in PHP. It includes MCQ questions on the different methods available to the exception class in PHP, ways of extending the exception base class, predefined exceptions offered by the standard PHP library.

Read Also: Top 20 MCQ Questions on Error Handling in PHP

1) There are … methods available to the exception class in PHP.
A. 5
B. 6
C. 7
D. 8

2) Which of the following is the correct order of the steps for implementing the exception handling process.
i. If the attempt fails, the exception-handling feature throws an exception.
ii. The application attempts to perform some task.
iii. The exception handling feature cleans-up any resources consumed during the attempt.
iv. The assigned handler catches the exception and performs any necessary tasks.
A. ii, i, iii and iv
B. ii, i, iv and iii
C. iv, ii, i and iii
D. i, ii, iii and iv

3) In PHP’s exception handling, the overloaded constructor offers additional functionality through the acceptance of the following optional parameters.
i. message
ii. error code
iii. previous
iv. next
A. i, ii and iii only
B. ii, iii and iv only
C. i, iii and iv only
D. All i, ii, iii and iv

4) The method …. in exception class will return an array consisting of information pertinent to the context in which the error occurred.
A. getArray()
B. getMessage()
C. getTrace()
D. getString()

5) The getPrevious() method in exception class was added in …
A. PHP 5.2
B. PHP 5.3
C. PHP 5.4
D. PHP 6

6) The standard PHP library offers access to … predefined exceptions.
A. 12
B. 13
C. 14
D. 15

7) The … class should be used to handle scenarios where an input value falls outside of a range.
A. DomainException
B. OutOfRangeException
C. OutOfBoundsException
D. OverflowException

8) The … class should be used to handle a function’s output values that fall outside of a predefined range.
A. DomainException
B. OutOfRangeException
C. OutOfBoundsException
D. OverflowException

9) The … class should be used to handle situations where a provided value does not match any of an array’s defined keys.
A. UnexpectedValueException
B. OutOfRangeException
C. DomainException
D. OutOfBoundsException

10) The … class should be used to handle situations where an arithmetic or buffer overflow occurs.
A. DomainException
B. OutOfRangeException
C. OutOfBoundsException
D. OverflowException

11) The … class should be used to handle situations where a provided value does not match any of a predefined set of values.
A. UnexpectedValueException
B. OutOfRangeException
C. DomainException
D. OutOfBoundsException

12) Which of the following are the methods available to the exception class in PHP.
i. getCode()
ii. getLine()
iii. getString()
iv. getTrace()
A. i, ii and iii only
B. ii, iii and iv only
C. i, ii and iv only
D. All i, ii, iii and iv

13) The … class is used when performing an invalid operation on an empty container, such as removing an element.
A. BadFunctionCallException
B. BadMethodCallException
C. RangeException
D. UnderflowException

14) State whether the following statements about the RangeException class is TRUE or FALSE.
i. It indicates the range of errors during program execution.
ii. There was an arithmetic error other than under/overflow.
ii. This is the compile-time version of DomainException.
A. i-True, ii-False, iii-True
B. i-True, ii-False, iii-False
C. i-True, ii-True, iii-True
D. i-True, ii-True, iii-False

15) … handles exceptions due to value being too small to maintain precision, resulting in loss of accuracy.
A. BadFunctionCallException
B. BadMethodCallException
C. RangeException
D. UnderflowException

16) The … class is used if a callback refers to an undefined method or if some arguments are missing.
A. BadFunctionCallException
B. BadMethodCallException
C. RangeException
D. UnderflowException

17) The … class is used if a callback refers to an undefined function or if some arguments are missing.
A. BadFunctionCallException
B. BadMethodCallException
C. RangeException
D. UnderflowException

18) … class handles the situations where an application is programmed incorrectly, such as when there is an attempt to invoke a method before a class attribute has been set.
A. LengthException
B. LogicException
C. RangeException
D. UnderflowException

19) The … class is used to handle arithmetic errors unrelated to overflow and underflow.
A. BadFunctionCallException
B. BadMethodCallException
C. RangeException
D. UnderflowException

20) The … class should be used to handle situations where an argument of an incompatible type is passed to a function or method.
A. LengthException
B. LogicException
C. RangeException
D. InvalidArgumentException

Answers

  1. C. 7
  2. B. ii, i, iv and iii
  3. A. i, ii and iii only
  4. C. getTrace()
  5. B. PHP 5.3
  6. B. 13
  7. A. DomainException
  8. B. OutOfRangeException
  9. D. OutOfBoundsException
  10. D. OverflowException
  11. A. UnexpectedValueException
  12. C. i, ii and iv only
  13. D. UnderflowException
  14. D. i-True, ii-True, iii-False
  15. D. UnderflowException
  16. B. BadMethodCallException
  17. A. BadFunctionCallException
  18. B. LogicException
  19. C. RangeException
  20. D. InvalidArgumentException

Read Next: Top 20 MCQ Questions on POSIX Regular Expressions in PHP

]]>
https://www.siteforinfotech.com/mcq-questions-on-exception-handling-in-php/feed 0
4 Benefits of Hiring a Top SEO Agency https://www.siteforinfotech.com/benefits-of-hiring-a-top-seo-agency/ https://www.siteforinfotech.com/benefits-of-hiring-a-top-seo-agency/#respond Fri, 16 Oct 2020 10:31:02 +0000 https://www.siteforinfotech.com/?p=8898 Search engine optimization is a fundamental strategy that’ll help your business flourish. SEO services are time-consuming, especially if you’re a beginner. Therefore, business owners should hire a reputable and experienced SEO agency. For hiring a top SEO agency, you should ensure that the SEO firm has a minimum of five years of experience. To determine the reputation of the SEO firm, you should rely on reviews and clients’ testimonials.

A credible and reliable SEO expert will use the right strategies to ensure your website drives organic traffic and ranks higher. Choosing the right SEO agency can be a daunting task because there’s stiff competition. Therefore, it’s a great idea to invest your time because it’s worth it on the long term basis.

Read Also: Top 40 SEO Tips for Small Business Website

Benefits of hiring a top SEO agency

Here are the main benefits of hiring a top SEO agency. It will help you in optimizing your website in correct way with increasing brand awareness and conversion rate without any negative impacts on your websites.

1. Prolonged Results

A professional SEO specialist will work efficiently until your websites drive organic traffic. A pro will follow steps and guidelines in optimizing your website. Avoid doing it yourself because you’ll be prone to mistakes, thus impacting your reputation negatively. The right SEO agency will use the right keywords in order to focus on your target customers. Increasing traffic on your website will impact your revenue positively in the long run. The main objective of a successful SEO expert is to help you attain your set goals.

Read Also: How to Localize Content and Boost Your SEO – 5 Tips

2. Brand Awareness

Search engine optimization plays a vital role in improving brand awareness and reputation. A well-optimized website will have increased traffic of potential buyers. Therefore, many individuals will have in-depth information and trust in your brand. Building trust with potential clients is important because you’ll increase your output and minimize input. Brand awareness is key to helping a product attain a reliable market share. Clients will mostly purchase products or services with a high market share.

3. Improve Conversion Rate

Digital marketing strategies are key in converting target buyers into loyal customers. Search engine optimization is among the best strategies that will improve your sales. A well-optimized website will rank higher in search engines, thus attracting new buyers who are interested in your product or service. The best SEO expert will use the latest search engine optimization tools to help you rank at the top. This will, therefore, improve organic traffic, thus increasing the conversion rate. Increasing your buyers will automatically improve your sales, thus helping you optimize your profit.

Digital marketing strategies

4. Time Management

SEO techniques are a complicated channel that requires a professional touch. Time is an essential asset that plays a major part in improving the growth and development of your business. An SEO expert will use the latest SEO tools to optimize your website. Avoid the do it yourself approach because advanced SEO tools require certain expertise and skills. Therefore, the DIY approach will be a time-consuming task. Hiring pro SEO experts will help you save time because they have sufficient skills and knowledge. You’ll, therefore, concentrate on other valuable projects that can help you excel in your field of specialization.

Conclusion

The right SEO agency will analyze and evaluate your website in order to use strategies that will help you stand out in a competitive industry.

Read Next: Most Important Tips for Search Engine Optimization (SEO)

]]>
https://www.siteforinfotech.com/benefits-of-hiring-a-top-seo-agency/feed 0
Top 20 MCQ Questions on Error Handling in PHP https://www.siteforinfotech.com/mcq-questions-on-error-handling-in-php/ https://www.siteforinfotech.com/mcq-questions-on-error-handling-in-php/#respond Thu, 15 Oct 2020 16:43:09 +0000 https://www.siteforinfotech.com/?p=8879 This set of top 20 MCQ questions on error handling in PHP includes the collections of multiple-choice questions on the fundamentals of error handling method in PHP. It includes MCQ questions on the different error levels available in PHP, PHP configuration directives, and PHP’s error logging functions and their parameters.

Read Also: Top 20 MCQ Questions on Namespaces in PHP

1) There are … separate error levels are available in PHP.
A. Fifteen
B. Sixteen
C. Seventeen
D. Eighteen

2) The … error level was introduced in …
A. PHP 5.2
B. PHP 5.3
C. PHP 5.4
D. PHP 6

3) In PHP’s error reporting, the … level reports fatal run-time errors.
A. E_ERROR
B. E_RUN_ERROR
C. E_NOTICE
D. R_ERROR

4) In PHP’s error reporting, the … level reports compile-time parse errors.
A. E_ERROR
B. E_PARSE_ERROR
C. E_COMPILE_PARSE
D. E_PARSE

5) In the … level, warnings regarding user-initiated use of features scheduled for removal in future PHP release.
A. E_DEPRECATED
B. E_USER_DEPRECATED
C. E_USER_ERROR
D. E_USER_REMOVAL

6) The error level … suggest code changes based on the developer’s determinations as to proper coding methodologies and is intended to ensure portability across PHP versions.
A. E_STRICT
B. E_WARNING
C. E_USER_WARNING
D. E_SUGGESTS

7) In PHP error handling, the … directives determine the reporting sensitivity level.
A. display_errors
B. error_reporting
C. error_log
D. display_startup_errors

8) Enabling the … directive results in the display of any errors meeting the criteria defined by error_reporing.
A. display_errors
B. log_error
C. error_log
D. display_startup_errors

9) The … directive will display any error encountered during the initialization of the PHP engine.
A. display_errors
B. error_reporting
C. error_log
D. display_startup_errors

10) Errors can be sent to the system logging daemon or can be sent to a file specified by the administrator via the … directives.
A. display_errors
B. error_reporting
C. error_log
D. display_startup_errors

11) Enabling … causes PHP to disregard repeated error messages that occur within the same file on the same line.
A. ignore_repeated_errors
B. ignore_repeated_source
C. repeated_error_messages
D. ignore_repeated_error_messages

12) Enabling … causes PHP to disregarded repeated error messages emanating from different files or different lines within the same file.
A. ignore_repeated_errors
B. ignore_repeated_source
C. repeated_error_messages
D. ignore_repeated_error_messages

13) While opening the logging connection, the … option immediately opens the connection to the Syslog.
A. LOG_CONS
B. LOG_DELAY
C. LOG_NDELAY
D. LOG_ODELAY

14) While opening the logging connection, the … option does not open the connection until the first message has been submitted for logging.
A. LOG_CONS
B. LOG_DELAY
C. LOG_NDELAY
D. LOG_ODELAY

15) … is the parameter of Syslog() function which specifies a serious system problem, likely signaling a crash.
A. LOG_EMERG
B. LOG_CRIT
C. LOG_ERR
D. LOG_WARNING

16) … is the parameter of Syslog() function which specifies a critical error that could render a service unusable but does not necessarily place the system in danger.
A. LOG_EMERG
B. LOG_CRIT
C. LOG_ERR
D. LOG_WARNING

17) State whether the following statements about PHP’s logging facility are TRUE or FALSE.
i. PHP’s logging facilities will automatically be initialized when the openlog() or Syslog() functions are called.
ii. Calling the openlog() function is necessary.
iii.The Syslog() function is responsible for sending a custom message to the system log.
A. i-True, ii-True, iii-False
B. i-True, ii-False, iii-False
C. i-True, ii-False, iii-True
D. i-True, ii-True, iii-True

18) The error level … indicate that the script encountered something that could indicate an error.
A. E_ERROR
B. E_RUN_ERROR
C. E_NOTICE
D. R_ERROR

19) Enabling … causes PHP to store the most recent error message in the variable $php_errormsg.
A. display_errors
B. track_errors
C. track_recent_errors
D. display_track_errors

20) In the openlog() function, the logging option … will output the logged message to both the Syslog and standard error.
A. LOG_PERROR
B. LOG_PID
C. LOG_CONS
D. LOG_DELAY

Answers

  1. B. Sixteen
  2. C. PHP 5.4
  3. A. E_ERROR
  4. D. E_PARSE
  5. B. E_USER_DEPRECATED
  6. A. E_STRICT
  7. B. error_reporting
  8. A. display_errors
  9. D. display_startup_errors
  10. C. error_log
  11. A. ignore_repeated_errors
  12. B. ignore_repeated_source
  13. C. LOG_NDELAY
  14. D. LOG_ODELAY
  15. A. LOG_EMERG
  16. B. LOG_CRIT
  17. C. i-True, ii-False, iii-True
  18. C. E_NOTICE
  19. B. track_errors
  20. A. LOG_PERROR

Read Next: Top 20 MCQ Questions on Exception Handling in PHP

]]>
https://www.siteforinfotech.com/mcq-questions-on-error-handling-in-php/feed 0