Go Back   Gaming Gutter > Non-Gaming > Programming > Tutorials


Tutorials - Looking for programming tutorials to increase your knowledge? Do so here.

» Site Navigation
» Home
» FAQ
» Log in
User Name:

Password:

Not a member yet?
Register Now!
» Advertisement
» GG Stuff

Follow us on Twitter!

Get the GG toolbar today (for firefox only)
» Recent Threads
Go to first new post Random rant.. Kinda.
Today 09:29 PM
Last post by tealeaf
Today 10:06 PM
11 Replies, 12 Views
Go to first new post Bullshit
03-11-2010 08:49 PM
by tealeaf
Last post by tealeaf
Today 10:03 PM
23 Replies, 95 Views
Go to first new post Darksiders (Xbox 360 and...
01-07-2010 03:15 PM
Last post by LegitGaiaGamer
Today 10:00 PM
7 Replies, 135 Views
Go to first new post MW2 - Favorite Class?
12-10-2009 09:01 PM
by Vin
Last post by LegitGaiaGamer
Today 09:57 PM
9 Replies, 223 Views
Go to first new post What game(s) are you...
01-23-2010 11:53 PM
by Calliss
Last post by LegitGaiaGamer
Today 09:55 PM
22 Replies, 296 Views
Reply
 
LinkBack Thread Tools Display Modes

 VB-like functions.
Old 12-04-2006, 01:48 PM   #1 (permalink)
Full Member

Male gommle is offline
 
gommle's Avatar
 
Join Date: Sep 2006
Location: The o great land of Nooooooreeeway
Age: 21
Posts: 695
GPoints: 425
iTrader: 0 / 0%
gommle Is Recognizable
Rep Power: 11
VB-like functions.

Damn, error again. Just DL the txt file and view in Dreamviewer or something.

< Ignore this post for now, I can't delete it. >
Attached Files
File Type: txt lol.txt (1.8 KB, 3 views)

Last edited by gommle; 12-04-2006 at 02:15 PM..
  Reply With Quote

 Re: VB-like functions.
Old 12-04-2006, 02:22 PM   #2 (permalink)
Junior Member

Male Xenos is offline
 
Join Date: Nov 2006
Posts: 19
GPoints: 18
iTrader: 0 / 0%
Xenos Is a New Face in Town
Rep Power: 0
Re: VB-like functions.

Just to tell you, using regular expressions for the GetBetween function simply increases usage time. There is NO point whatsoever in using regular expressions. A better function would be like this:

PHP Code:
 function getBetween($data,$s,$e)
{
$sint strpos($data,$s);
$eint strpos($data,$e,$sint);
return 
substr($data,$sint,$eint-$sint);

That will cut down execution time, although I suppose it isn't very useful unless you use that function a ton in your script
  Reply With Quote

 Re: VB-like functions.
Old 12-05-2006, 03:12 AM   #3 (permalink)
Full Member

Male gommle is offline
 
gommle's Avatar
 
Join Date: Sep 2006
Location: The o great land of Nooooooreeeway
Age: 21
Posts: 695
GPoints: 425
iTrader: 0 / 0%
gommle Is Recognizable
Rep Power: 11
Re: VB-like functions.

Here's another function I use sometimes.
<?php

function getBetween($str, $start, $end) {
$startlen = strlen($start);
if (($startpos = strpos($str, $start)) !== false
&& ($endpos = strpos($str, $end)) !== false
&& ($skip = $startpos + $startlen) <= $endpos) {
return substr($str, $skip, $endpos - $skip);
} else {
return false;
}
}

?>
  Reply With Quote
Reply

Bookmarks



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Powered by vBadvanced CMPS v3.1.0

All times are GMT -7. The time now is 10:08 PM.


vBulletin skin developed by: eXtremepixels
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The contents of this webpage are copyright © 2006-2008 GamingGutter.com. All Rights Reserved.

Page generated in 0.25886798 seconds (100.00% PHP - 0% MySQL) with 22 queries