473,785 Members | 2,412 Online
Bytes | Software Development & Data Engineering Community
+ 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 = "Thisisanexampl evariabele."

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

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

$var = "This is an example variabele."

To :

$var = "Thisisanexampl evariabele."


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.supernew s.com>, Scriptdude wrote:
InSeCo wrote:
Hello,

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

$var = "This is an example variabele."

To :

$var = "Thisisanexampl evariabele."


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
1797
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 online documentation talk about a "ESPACIOS()" function, but it
3
3337
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 0-9-765-4321 Result I want:
135
7527
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 which is better. It has become what's known as “religious war” — a heated fight over trivia. In this essay, i like to explain what is the situation behind it, and which is proper.
7
11214
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 as many as 20 or more at a time) because my users are allowed to type spaces in their text. For storage and other manipulation, I don't need all those spaces. If I explode it I'm left with thousands of empty (null?) elements in the array. I can...
10
2974
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 22222 D E F 33333 G H I 44444 J K L
4
2215
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 SpecialFolder.ApplicationData (C:\Documents and Settings\Username\Application Data) ? Or, is there some way to get the ms installer to do this for you? Is there some way to use Application.UserAppDataPath to ease finding
4
3015
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 2.5 Class-2 0 I tried a few examples from the group and it didn't work, since the file also has a header row and a row of seperators ( -------). The lengths of each row is something like 130, so there are extra spaces after...
3
2179
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 not thinking and placed spaces into some of my table names. When I go to use the INPUT INTO statement, it gives me an error. Is there a way I can get it to work without having to change the table names? If I have to change them I will, I was just...
1
2041
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
9645
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
10155
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10095
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9954
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7502
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6741
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5383
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5513
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4054
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 we have to send another system

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.