Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Search and delete
Hello,

how can I delete a part from an array?

I want to search in the array to the first 5 characters, after that I want
to delete the value from the array!

## Before
$example = array(
1 => '1001,sastu',
2 => '1003,dudaa',
3 => '1006,s1001fd',
4 => '1008,empdat',
5 => "1010,limaad",
);

##after searching for "1006," the record must be deleted!
$example = array(
1 => '1001,sastu',
2 => '1003,dudaa',
4 => '1008,empdat',
5 => "1010,limaad",
);

Thnx,
InseCo








Report this thread to moderator Post Follow-up to this message
Old Post
InSeCo
04-18-05 01:55 PM


Re: Search and delete
Hi!

I suggest that your script run over the array, and use fnmatch (or preg)
to know whether it's the one what it wants to find.

Best regards
Titan

InSeCo wrote:
> Hello,
>
> how can I delete a part from an array?
>
> I want to search in the array to the first 5 characters, after that I want
> to delete the value from the array!
>
> ## Before
> $example = array(
>      1 => '1001,sastu',
>      2 => '1003,dudaa',
>      3 => '1006,s1001fd',
>      4 => '1008,empdat',
>      5 => "1010,limaad",
>    );
>
> ##after searching for "1006," the record must be deleted!
> $example = array(
>      1 => '1001,sastu',
>      2 => '1003,dudaa',
>      4 => '1008,empdat',
>      5 => "1010,limaad",
>    );
>
> Thnx,
> InseCo
>
>
>
>
>
>
>

Report this thread to moderator Post Follow-up to this message
Old Post
Sebestyén Dénes
04-18-05 01:55 PM


Re: Search and delete
Hi!

I suggest that your script run over the array, and use fnmatch (or preg)
to know whether it's the one what it wants to find.

Best regards
Titan

InSeCo wrote:
> Hello,
>
> how can I delete a part from an array?
>
> I want to search in the array to the first 5 characters, after that I want
> to delete the value from the array!
>
> ## Before
> $example = array(
>      1 => '1001,sastu',
>      2 => '1003,dudaa',
>      3 => '1006,s1001fd',
>      4 => '1008,empdat',
>      5 => "1010,limaad",
>    );
>
> ##after searching for "1006," the record must be deleted!
> $example = array(
>      1 => '1001,sastu',
>      2 => '1003,dudaa',
>      4 => '1008,empdat',
>      5 => "1010,limaad",
>    );
>
> Thnx,
> InseCo
>
>
>
>
>
>
>

Report this thread to moderator Post Follow-up to this message
Old Post
Sebestyén Dénes
04-20-05 01:55 PM


Re: Search and delete
Hi!

I suggest that your script run over the array, and use fnmatch (or preg)
to know whether it's the one what it wants to find.

Best regards
Titan

InSeCo wrote:
> Hello,
>
> how can I delete a part from an array?
>
> I want to search in the array to the first 5 characters, after that I want
> to delete the value from the array!
>
> ## Before
> $example = array(
>      1 => '1001,sastu',
>      2 => '1003,dudaa',
>      3 => '1006,s1001fd',
>      4 => '1008,empdat',
>      5 => "1010,limaad",
>    );
>
> ##after searching for "1006," the record must be deleted!
> $example = array(
>      1 => '1001,sastu',
>      2 => '1003,dudaa',
>      4 => '1008,empdat',
>      5 => "1010,limaad",
>    );
>
> Thnx,
> InseCo
>
>
>
>
>
>
>

Report this thread to moderator Post Follow-up to this message
Old Post
Sebestyén Dénes
04-25-05 08:56 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP Language archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 07:14 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.