Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add extra whitespace in PHP?

Tags:

php

whitespace

I was wondering how can I add extra whitespace in php is it something like \s please help thanks.

Is there a tutorial that list these kind of things thanks.

like image 909
pnut Avatar asked Feb 19 '10 22:02

pnut


People also ask

What is white space in PHP?

PHPProgrammingServer Side Programming. The ctype_space() function in PHP check for whitespace character(s). It returns TRUE if every character in text creates some sort of white space, FALSE otherwise. Besides the blank character this also includes tab, vertical tab, line feed, carriage return and form feed characters.

Does spacing matter in PHP?

Whitespaces are generally ignored in PHP syntax, but there are several places where you cannot put them without affecting the sense (and the result).

What is Br in PHP?

Using Line Breaks as in HTML: The <br> tag in HTML is used to give the single line break. It is an empty tag, so it does not contain an end tag. Syntax: </br> Example: PHP.

Is PHP white space sensitive?

PHP is whitespace insensitive PHP whitespace insensitive means that it almost never matters how many whitespace characters you have in a row. one whitespace character is the same as many such characters.


1 Answers

Like this:

 str_repeat('&nbsp;', 5); // adds 5 spaces 
like image 191
Sarfraz Avatar answered Sep 28 '22 02:09

Sarfraz