PHP Coding
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPHP Coding

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old November 15th, 2002, 02:59 AM
nebix nebix is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 8 nebix User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Another one hehe, about include

Hey guys, another annoying question. I have a name.php file with this content-
<?php $name="nebix"; ?>
I want to include it into index.php and have the variable $name with the value nebix available for use. I tried using just an include(name.php); but it doesnt work.
Also, a bonus question... How do I remove the last character(a space) from a string?

Thank You, help the php n00bs

Reply With Quote
  #2  
Old November 15th, 2002, 03:07 AM
postalcow postalcow is offline
Codewalkers Beginner (1000 - 1499 posts)
 
Join Date: Apr 2007
Location: Ford CIty, PA USA
Posts: 1,267 postalcow User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 3
Send a message via Yahoo to postalcow
RE: Another one hehe, about include

White space, use
trim($your_variable);
function more info on syntax at http://www.php.net/manual/en/function.trim.php

include syntax
include ("name.php");

Reply With Quote
  #3  
Old November 15th, 2002, 03:09 AM
bob0099 bob0099 is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: manchester,n.h.,usa
Posts: 172 bob0099 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: Another one hehe, about include

include(name.php);

should be: include('name.php');

and use the trim() function to get rid of whitespace
http://www.php.net/manual/en/function.trim.php

Reply With Quote
  #4  
Old November 15th, 2002, 03:10 AM
bob0099 bob0099 is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: manchester,n.h.,usa
Posts: 172 bob0099 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: Another one hehe, about include

hey PC . I left you a note in the mail server forum

Reply With Quote
  #5  
Old November 15th, 2002, 04:01 AM
Lizardman Lizardman is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 113 Lizardman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: Another one hehe, about include


Quote:
Also, a bonus question... How do I remove the last character(a space) from a string?


To remove JUST the last character, use:

php Code:
Original - php Code
  1. rtrim($variable)


Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Coding > Another one hehe, about include


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway