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
» Recent Threads
Go to first new post Ruzzykinz.
Today 06:14 PM
Last post by Vaginal-Milkshake
Today 06:41 PM
35 Replies, 67 Views
Go to first new post Selling 18 million pure...
11-28-2008 10:06 PM
by Sticky
Last post by Horde
Today 06:40 PM
6 Replies, 83 Views
Go to first new post Its my Birthday tomorrow.
12-02-2008 07:23 AM
by Zombies
Last post by Bex
Today 06:38 PM
59 Replies, 300 Views
Go to first new post Fucking AMAZING!!!
11-21-2008 02:16 PM
Last post by Hale'iwa
Today 06:38 PM
13 Replies, 118 Views
Go to first new post Buy it NOW! Special...
11-19-2008 10:30 PM
Last post by babygi9538
Today 06:34 PM
71 Replies, 888 Views
Reply
 
LinkBack Thread Tools Display Modes

 VB-like functions.
Old 12-04-2006, 02:48 PM   #1 (permalink)
Underground

Male gommle is offline
 
gommle's Avatar
 
Join Date: Sep 2006
Location: The o great land of Nooooooreeeway
Age: 20
Posts: 658
GPoints: 46
iTrader: 0 / 0%
gommle Is Recognizable
Rep Power: 7
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 03:15 PM..
  Reply With Quote

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

Male Xenos is offline
 
Join Date: Nov 2006
Posts: 19
GPoints: 3
iTrader: 0 / 0%
Xenos Is gaining popularity
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, 04:12 AM   #3 (permalink)
Underground

Male gommle is offline
 
gommle's Avatar
 
Join Date: Sep 2006
Location: The o great land of Nooooooreeeway
Age: 20
Posts: 658
GPoints: 46
iTrader: 0 / 0%
gommle Is Recognizable
Rep Power: 7
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.0 RC2

All times are GMT -7. The time now is 06:42 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.10872412 seconds (100.00% PHP - 0% MySQL) with 20 queries