473,465 Members | 1,922 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Delete spaces from variabele

Hello,

How can you delete spaces within a variabele (php4)?

$var = "This is an example variabele."

To :

$var = "Thisisanexamplevariabele."

Jul 17 '05 #1
3 1947
InSeCo wrote:
Hello,

How can you delete spaces within a variabele (php4)?

$var = "This is an example variabele."

To :

$var = "Thisisanexamplevariabele."


Simple.

$var = str_replace(" ", "", $var);

--
Computers will never take the place of books. You can't stand on a
floppy disk to reach a high shelf.
I thought 'Deep Throat' was a movie about a giraffe :/
Jul 17 '05 #2
In article <11*************@corp.supernews.com>, Scriptdude wrote:
InSeCo wrote:
Hello,

How can you delete spaces within a variabele (php4)?

$var = "This is an example variabele."

To :

$var = "Thisisanexamplevariabele."


Simple.

$var = str_replace(" ", "", $var);


It's a bit better if $var = str_replace(' ', '', $var) since
double quotes will result in an unnecessary parsing. Right?
Jul 17 '05 #3
Daniel C. Bastos wrote:
It's a bit better if $var = str_replace(' ', '', $var) since
double quotes will result in an unnecessary parsing. Right?


True.

--
Computers will never take the place of books. You can't stand on a
floppy disk to reach a high shelf.
I thought 'Deep Throat' was a movie about a giraffe :/
Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Francisco | last post by:
Hello: i want to know how to delete inner spaces between words of a field in a access table? For example, i need to convert a text field like "one two etc" in "one two etc" The...
3
by: Zheve | last post by:
Help please, I want to write a query to delete spaces and other various between numbers (which is set as text field due to the data that is put in) as follows: Currently as: 0-9-123 4567 OR...
135
by: Xah Lee | last post by:
Tabs versus Spaces in Source Code Xah Lee, 2006-05-13 In coding a computer program, there's often the choices of tabs or spaces for code indentation. There is a large amount of confusion about...
7
by: ClarkePeters | last post by:
I have large text files that I read into an array, but before that I take out all the special characters such as tabs, new lines, and returns. However I'm left with all the extra spaces (sometimes...
10
by: amiga500 | last post by:
Hello, I have one basic simple question. When I have multiple records in the datagrid as follows: Code Product 1 Product 2 Product 3 11111 A B C...
4
by: - HAL9000 | last post by:
When un-installing an application... Is it normal practice to write a special program that erases all the files and folders for all the users of an application that reads and writes to...
4
by: koutoo | last post by:
If I have a text file that is delimited by spaces, how do I import it and get to comma delimited? Here is a row of data from the text file: 1 1 10:55:14 2 65 8.5 1.4+1.1 ...
3
by: rudeman76 | last post by:
Hello, I have 2 DB that are linked (they are pretty much identical). I have an append sql statement. It works fine for most of it. I just have two questions. 1. When I started the DB I was...
1
by: susan | last post by:
Hoi, In een formulier roep ik een module aan. Hoe kan ik de waarde van een variabele uit de module terughalen naar mijn formulier? Dank jullie, Susan
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.